Skip to content

Commit

Permalink
use nested eslint configs and remove "getXConfiguration" file pattern…
Browse files Browse the repository at this point in the history
…s pattern, phetsims/chipper#1483
  • Loading branch information
zepumph committed Dec 2, 2024
1 parent 7951bbb commit 8a191fb
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 18 deletions.
20 changes: 2 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,10 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import { getBrowserConfiguration } from '../perennial-alias/js/eslint/config/browser.eslint.config.mjs';
import rootEslintConfig from '../perennial-alias/js/eslint/config/root.eslint.config.mjs';
import getNodeConfiguration from '../perennial-alias/js/eslint/config/util/getNodeConfiguration.mjs';
import browserEslintConfig from '../perennial-alias/js/eslint/config/browser.eslint.config.mjs';

const nodeJSDirs = [
'js/config/**',
'js/grunt/**',
'js/local/**',
'js/node-client/**',
'js/server/**'
];
export default [
...rootEslintConfig,
...getBrowserConfiguration( {
files: [ '**/*' ],
ignores: nodeJSDirs
} ),
...getNodeConfiguration( {
files: nodeJSDirs
} ),
...browserEslintConfig,
{
languageOptions: {
globals: {
Expand Down
14 changes: 14 additions & 0 deletions js/config/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024, University of Colorado Boulder

/**
* ESLint configuration for aqua.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import nodeEslintConfig from '../../../perennial-alias/js/eslint/config/node.eslint.config.mjs';

export default [
...nodeEslintConfig
];
20 changes: 20 additions & 0 deletions js/grunt/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2024, University of Colorado Boulder

/**
* ESLint configuration for aqua.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import nodeEslintConfig from '../../../perennial-alias/js/eslint/config/node.eslint.config.mjs';

export default [
...nodeEslintConfig,
{
// TODO: remove once the path works in root config againt, https://github.com/phetsims/chipper/issues/1483/
rules: {
'@typescript-eslint/no-floating-promises': 'off'
}
}
];
14 changes: 14 additions & 0 deletions js/node-client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024, University of Colorado Boulder

/**
* ESLint configuration for aqua.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import nodeEslintConfig from '../../../perennial-alias/js/eslint/config/node.eslint.config.mjs';

export default [
...nodeEslintConfig
];
14 changes: 14 additions & 0 deletions js/server/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024, University of Colorado Boulder

/**
* ESLint configuration for aqua.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import nodeEslintConfig from '../../../perennial-alias/js/eslint/config/node.eslint.config.mjs';

export default [
...nodeEslintConfig
];

0 comments on commit 8a191fb

Please sign in to comment.