Skip to content

Commit

Permalink
Address and move TODOs, phetsims/chipper#1451
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid authored and zepumph committed Oct 22, 2024
1 parent 2dbc19f commit 67cf6f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
9 changes: 2 additions & 7 deletions eslint/node.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@
* @author Sam Reid (PhET Interactive Simulations)
*/

import globals from 'globals';
import rootEslintConfig from './root.eslint.config.mjs';
import rootEslintConfig, { nodeLanguageOptions } from './root.eslint.config.mjs';

export const getNodeConfiguration = ( pattern = {} ) => {
return [
{
languageOptions: {
globals: {
...globals.node
}
},
languageOptions: nodeLanguageOptions,
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off'
Expand Down
21 changes: 7 additions & 14 deletions eslint/root.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ import todoShouldHaveIssue from './rules/todo-should-have-issue.js';
import uppercaseStaticsShouldBeReadonly from './rules/uppercase-statics-should-be-readonly.js';
import visibilityAnnotation from './rules/visibility-annotation.js';

// TODO: Review this file, see https://github.com/phetsims/chipper/issues/1451
export const nodeLanguageOptions = {
globals: {
...globals.node
}
};

/**
* The base eslint configuration for the PhET projects.
*
Expand Down Expand Up @@ -76,14 +81,8 @@ export default [
},
{
files: [ 'Gruntfile.js' ],
// TODO: reuse same thing as node.eslint.config? https://github.com/phetsims/chipper/issues/1451
languageOptions: {
globals: {
...globals.node
}
}
languageOptions: nodeLanguageOptions
},

{
plugins: {
phet: {
Expand Down Expand Up @@ -176,12 +175,6 @@ export default [

languageOptions: {

// TODO: upgrade version: Maybe 2022? https://github.com/phetsims/chipper/issues/1451
ecmaVersion: 2022,

// TODO: Does all code use sourceType module?, see https://github.com/phetsims/chipper/issues/1451
sourceType: 'module',

// Without a parser, .js files are linted without es6 transpilation. Use the same parser that we use for TypeScript.
parser: typescriptEslintParser
},
Expand Down

0 comments on commit 67cf6f3

Please sign in to comment.