@adobe/eslint-config-helix
Version:
Helix's ESLint config, based on Airbnb's style guide
58 lines (46 loc) • 1.84 kB
JavaScript
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import globals from 'globals';
export default {
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
// enforce return after a callback
'callback-return': 'off',
// require all requires be top-level
// https://eslint.org/docs/rules/global-require
'global-require': 'error',
// enforces error handling in callbacks (node environment)
'handle-callback-err': 'off',
// disallow use of the Buffer() constructor
// https://eslint.org/docs/rules/no-buffer-constructor
'no-buffer-constructor': 'error',
// disallow mixing regular variable and require declarations
'no-mixed-requires': ['off', false],
// disallow use of new operator with the require function
'no-new-require': 'error',
// disallow string concatenation with __dirname and __filename
// https://eslint.org/docs/rules/no-path-concat
'no-path-concat': 'error',
// disallow use of process.env
'no-process-env': 'off',
// disallow process.exit()
'no-process-exit': 'off',
// restrict usage of specified node modules
'no-restricted-modules': 'off',
// disallow use of synchronous methods (off by default)
'no-sync': 'off',
},
};