eslint-flat-config-airbnb
Version:
A mostly reasonable approach to JavaScript and React using Airbnb's ESLint config, updated for ESLint 9+
34 lines (31 loc) • 1.29 kB
JavaScript
import confusingBrowserGlobals from 'confusing-browser-globals';
const variables = {
rules: {
'init-declarations': 'off',
'no-catch-shadow': 'off',
'no-delete-var': 'error',
'no-label-var': 'error',
'no-restricted-globals': [
'error',
{
name: 'isFinite',
message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
},
{
name: 'isNaN',
message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
},
].concat(confusingBrowserGlobals.map((g) => ({
name: g,
message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
}))),
'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-undefined': 'off',
'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
},
};
export default variables;