-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
64 lines (58 loc) · 1.82 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2024, University of Colorado Boulder
/**
* ESLint configuration for rosetta.
*
* @author Sam Reid (PhET Interactive Simulations)
* @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 reactPlugin from '../perennial-alias/node_modules/eslint-plugin-react/index.js';
const browserFiles = [
'src/client/**/*'
];
export default [
reactPlugin.configs.flat.recommended,
...rootEslintConfig,
...getNodeConfiguration( {
files: [ '**/*' ],
ignores: browserFiles
} ),
...getBrowserConfiguration( {
files: browserFiles
} ),
{
rules: {
'phet/bad-sim-text': 'off',
'jsx-quotes': [
'error',
'prefer-single'
],
'require-atomic-updates': [
'error',
{ allowProperties: true }
],
'phet/default-import-match-filename': 'off',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
// This rule doesn't apply to Rosetta.
// See https://github.com/phetsims/phet-core/issues/100 for paper trail.
'phet/default-export-class-should-register-namespace': 'off',
// It isn't clear that rosetta wants to use perennial's node modules via npm-dependencies/. If this isn't true,
// please see https://github.com/phetsims/perennial/issues/372 and fix in rosetta.
'no-restricted-imports': 'off'
},
settings: {
react: {
version: 'detect'
}
}
}, {
// Separate block so that we globally ignore this
ignores: [
'static/*',
'src/client/dist/**/*'
]
}
];