Skip to content

Commit

Permalink
Update eslint.config.mjs for browser vs node, see phetsims/chipper#1463
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid authored and zepumph committed Oct 22, 2024
1 parent e00bc4e commit 4926a28
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 45 deletions.
18 changes: 0 additions & 18 deletions eslint/buildtools.eslint.config.mjs

This file was deleted.

16 changes: 0 additions & 16 deletions eslint/chipper.eslint.config.mjs

This file was deleted.

42 changes: 31 additions & 11 deletions eslint/node.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,39 @@
import globals from 'globals';
import rootEslintConfig from './root.eslint.config.mjs';

export const nodeLanguageOptionsAndRules = {
languageOptions: {
globals: {
...globals.node,

// Deno
// TODO: define only where needed https://github.com/phetsims/chipper/issues/1451
Deno: 'readonly'
}
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
};

export const nodeNoFloatingPromises = {

// For entry points like scripts and "grunt" tasks, we often end with a floating promise which is not a problem
files: [
'**/js/grunt/tasks/**/*',
'**/js/scripts/**/*'
],
rules: {
'@typescript-eslint/no-floating-promises': 'off'
}
};

/**
* The node-specific eslint config applied only to "server-side" files that aren't run in sims.
*/
export default [
...rootEslintConfig,
{
languageOptions: {
globals: {
...globals.node,

// Deno
// TODO: define only where needed https://github.com/phetsims/chipper/issues/1451
Deno: 'readonly'
}
}
} ];
nodeLanguageOptionsAndRules,
nodeNoFloatingPromises
];

0 comments on commit 4926a28

Please sign in to comment.