Skip to content

Commit

Permalink
Add getBrowserConfiguration, see 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 b42ee80 commit 2ea9f2a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions eslint/browser.eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@
import globals from 'globals';
import rootEslintConfig from './root.eslint.config.mjs';

export const browserGlobals = {
languageOptions: {
globals: {
...globals.browser
}
}
export const getBrowserConfiguration = ( pattern = {} ) => {
return [

// Where getBrowserConfiguration is included elsewhere, the call site must supply the rootEslintConfig.
{
languageOptions: {
globals: {
...globals.browser
}
},
...pattern
} ];
};

export default [

// Here, we must have a complete set of rules for interpretation, so we include the rootEslintConfig.
...rootEslintConfig,
browserGlobals
...getBrowserConfiguration()
];

0 comments on commit 2ea9f2a

Please sign in to comment.