node/doc/eslint.config_partial.mjs
Michaël Zasso 94c8178442
tools: move ESLint tools to tools/eslint
With ESLint flat config, we don't need a hack with `node_modules`
anymore to load ESLint plugins.
This commit moves the node-core plugin out of `tools/node_modules` and
creates a new `tools/eslint` directory to store ESLint tools.

PR-URL: https://github.com/nodejs/node/pull/53393
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-06-11 06:58:51 +00:00

41 lines
899 B
JavaScript

import { requireEslintTool } from '../tools/eslint/eslint.config_utils.mjs';
const globals = requireEslintTool('globals');
export default [
{
files: ['doc/**/*.md/*.{js,mjs,cjs}'],
rules: {
// Ease some restrictions in doc examples.
'no-restricted-properties': 'off',
'no-undef': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'symbol-description': 'off',
// Add new ECMAScript features gradually.
'prefer-const': 'error',
'prefer-rest-params': 'error',
'prefer-template': 'error',
// Stylistic rules.
'@stylistic/js/no-multiple-empty-lines': [
'error',
{
max: 1,
maxEOF: 0,
maxBOF: 0,
},
],
},
},
{
files: ['doc/api_assets/*.js'],
languageOptions: {
globals: {
...globals.browser,
},
},
},
];