Skip to content

Commit

Permalink
fix browser globals (out of root), phetsims/chipper#1451
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed Oct 22, 2024
1 parent 47c4953 commit 7fdbe44
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
10 changes: 0 additions & 10 deletions eslint/chipper.eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2018, University of Colorado Boulder
// @author Michael Kauzmann

import globals from 'globals';
import nodeEslintConfig from './node.eslint.config.mjs';

/**
Expand All @@ -10,15 +9,6 @@ import nodeEslintConfig from './node.eslint.config.mjs';
export default [
...nodeEslintConfig,
{

languageOptions: {
globals: {

// TODO: we would like to say exclude browser, but we will have to remove it from root.eslint.config.mjs to do so. See https://github.com/phetsims/chipper/issues/1451
// That is, we used to say browser: false. How to do that with flat?
...globals.node
}
},
rules: {
'phet/bad-chipper-text': 'error'
}
Expand Down
3 changes: 0 additions & 3 deletions eslint/node.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export default [
{
languageOptions: {
globals: {

// TODO: we would like to say exclude browser, but we will have to remove it from root.eslint.config.mjs to do so. See https://github.com/phetsims/chipper/issues/1451
// That is, we used to say browser: false. How to do that with flat?
...globals.node
}
},
Expand Down
13 changes: 9 additions & 4 deletions eslint/root.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1750,9 +1750,6 @@ export default [
}, {
languageOptions: {
globals: {

// ...globals.node,
...globals.browser,
...globals.es2018,

//=============================================================================================
Expand Down Expand Up @@ -1898,4 +1895,12 @@ export default [
}
}
}
];
];

export const browserGlobals = {
languageOptions: {
globals: {
...globals.browser
}
}
};
3 changes: 2 additions & 1 deletion eslint/sim.eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright 2018, University of Colorado Boulder
// @author Michael Kauzmann

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

/**
* Eslint config applied only to sims.
*/
export default [
...rootEslintConfig,
browserGlobals,
{
rules: {
'phet/bad-sim-text': 'error'
Expand Down

0 comments on commit 7fdbe44

Please sign in to comment.