eslint-config-airbnb-extended 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,6 +38,7 @@ The configuration may change over time, and `create-airbnb-x-config` will always
38
38
  This configuration relies on the following essential packages:
39
39
 
40
40
  - **`eslint-import-x`**: A powerful tool for managing and validating imports.
41
+ - **`eslint-plugin-n`**: Enforces best practices for Node.js.
41
42
  - **`eslint-plugin-react`**: Enforces React-specific linting rules and best practices.
42
43
  - **`eslint-plugin-react-hooks`**: Ensures proper use of React hooks.
43
44
  - **`eslint-plugin-jsx-a11y`**: Improves accessibility in JSX code.
@@ -2,8 +2,9 @@
2
2
  * Direct export not allowed, it will increase the size of d.ts
3
3
  */
4
4
  export declare const rules: {
5
- base: Record<"bestPractices" | "errors" | "es6" | "imports" | "node" | "strict" | "style" | "stylistic" | "variables" | "importsStrict" | "reactStrict", import("eslint").Linter.Config>;
6
- react: Record<"react" | "reactA11y" | "reactHooks", import("eslint").Linter.Config>;
5
+ base: Record<"bestPractices" | "errors" | "es6" | "imports" | "strict" | "style" | "stylistic" | "variables" | "importsStrict" | "reactStrict", import("eslint").Linter.Config>;
6
+ node: Record<"globals" | "base" | "promises" | "noUnsupportedFeatures", import("eslint").Linter.Config>;
7
+ react: Record<"react" | "reactJsxA11y" | "reactHooks", import("eslint").Linter.Config>;
7
8
  next: Record<"next", import("eslint").Linter.Config>;
8
9
  typescript: Record<"imports" | "base" | "typescriptEslint", import("eslint").Linter.Config>;
9
10
  };
@@ -11,12 +12,14 @@ export declare const configs: {
11
12
  base: Record<"all" | "recommended" | "typescript", import("eslint").Linter.Config[]>;
12
13
  react: Record<"all" | "recommended" | "typescript", import("eslint").Linter.Config[]>;
13
14
  next: Record<"all" | "recommended" | "typescript", import("eslint").Linter.Config[]>;
14
- node: Record<"all" | "recommended" | "typescript", import("eslint").Linter.Config[]>;
15
+ node: Record<"recommended", import("eslint").Linter.Config[]>;
15
16
  };
16
17
  export declare const plugins: {
17
- next: import("eslint").Linter.Config;
18
+ importX: import("eslint").Linter.Config;
19
+ node: import("eslint").Linter.Config;
18
20
  react: import("eslint").Linter.Config;
19
21
  reactA11y: import("eslint").Linter.Config;
20
22
  reactHooks: import("eslint").Linter.Config;
23
+ next: import("eslint").Linter.Config;
21
24
  typescriptEslint: import("eslint").Linter.Config;
22
25
  };
@@ -7,7 +7,6 @@ const best_practices_1 = __importDefault(require("../../rules/best-practices"));
7
7
  const errors_1 = __importDefault(require("../../rules/errors"));
8
8
  const es6_1 = __importDefault(require("../../rules/es6"));
9
9
  const imports_1 = __importDefault(require("../../rules/imports"));
10
- const node_1 = __importDefault(require("../../rules/node"));
11
10
  const strict_1 = __importDefault(require("../../rules/strict"));
12
11
  const style_1 = __importDefault(require("../../rules/style"));
13
12
  const stylistic_1 = __importDefault(require("../../rules/stylistic"));
@@ -17,7 +16,6 @@ const baseConfig = {
17
16
  errors: errors_1.default,
18
17
  es6: es6_1.default,
19
18
  imports: imports_1.default,
20
- node: node_1.default,
21
19
  strict: strict_1.default,
22
20
  style: style_1.default,
23
21
  stylistic: stylistic_1.default,
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const index_1 = __importDefault(require("../../configs/base/index"));
6
+ const base_1 = __importDefault(require("../../configs/base"));
7
7
  const baseRecommendedConfig = [
8
- ...Object.values(index_1.default),
8
+ ...Object.values(base_1.default),
9
9
  {
10
10
  name: 'airbnb/config/language-configurations',
11
11
  languageOptions: {
@@ -5,22 +5,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const recommended_1 = __importDefault(require("../configs/base/recommended"));
7
7
  const recommended_2 = __importDefault(require("../configs/next/recommended"));
8
- const recommended_3 = __importDefault(require("../configs/react/recommended"));
9
- const recommended_4 = __importDefault(require("../configs/typescript/recommended"));
8
+ const recommended_3 = __importDefault(require("../configs/node/recommended"));
9
+ const recommended_4 = __importDefault(require("../configs/react/recommended"));
10
+ const recommended_5 = __importDefault(require("../configs/typescript/recommended"));
10
11
  const base = {
11
12
  recommended: recommended_1.default,
12
- typescript: recommended_4.default.base,
13
- all: [...recommended_1.default, ...recommended_4.default.base],
13
+ typescript: recommended_5.default.base,
14
+ all: [...recommended_1.default, ...recommended_5.default.base],
14
15
  };
15
16
  const react = {
16
- recommended: recommended_3.default,
17
- typescript: recommended_4.default.react,
18
- all: [...recommended_3.default, ...recommended_4.default.react],
17
+ recommended: recommended_4.default,
18
+ typescript: recommended_5.default.react,
19
+ all: [...recommended_4.default, ...recommended_5.default.react],
19
20
  };
20
21
  const next = {
21
22
  recommended: recommended_2.default,
22
- typescript: recommended_4.default.next,
23
- all: [...recommended_2.default, ...recommended_4.default.next],
23
+ typescript: recommended_5.default.next,
24
+ all: [...recommended_2.default, ...recommended_5.default.next],
25
+ };
26
+ const node = {
27
+ recommended: recommended_3.default,
24
28
  };
25
29
  /**
26
30
  * as is given due to less size of index.d.ts
@@ -29,6 +33,6 @@ const configs = {
29
33
  base: base,
30
34
  react: react,
31
35
  next: next,
32
- node: base,
36
+ node: node,
33
37
  };
34
38
  exports.default = configs;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const nodeBase_1 = __importDefault(require("../../rules/node/nodeBase"));
7
+ const nodeGlobals_1 = __importDefault(require("../../rules/node/nodeGlobals"));
8
+ const nodeNoUnsupportedFeatures_1 = __importDefault(require("../../rules/node/nodeNoUnsupportedFeatures"));
9
+ const nodePromises_1 = __importDefault(require("../../rules/node/nodePromises"));
10
+ const nodeConfig = {
11
+ base: nodeBase_1.default,
12
+ globals: nodeGlobals_1.default,
13
+ promises: nodePromises_1.default,
14
+ noUnsupportedFeatures: nodeNoUnsupportedFeatures_1.default,
15
+ };
16
+ exports.default = nodeConfig;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ var _a, _b;
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
8
+ const node_1 = __importDefault(require("../../configs/node"));
9
+ const nodeNoUnsupportedFeatures_1 = __importDefault(require("../../rules/node/nodeNoUnsupportedFeatures"));
10
+ const flatNodeConfig = eslint_plugin_n_1.default.configs['flat/recommended'];
11
+ const nodeRecommendedConfig = [
12
+ ...Object.values(node_1.default),
13
+ Object.assign({ name: 'airbnb/config/node-configurations' }, (flatNodeConfig
14
+ ? {
15
+ languageOptions: flatNodeConfig.languageOptions,
16
+ rules: {
17
+ 'n/no-unsupported-features/es-syntax': (_b = (_a = flatNodeConfig.rules) === null || _a === void 0 ? void 0 : _a['n/no-unsupported-features/es-syntax']) !== null && _b !== void 0 ? _b : nodeNoUnsupportedFeatures_1.default.rules['n/no-unsupported-features/es-syntax'],
18
+ },
19
+ }
20
+ : null)),
21
+ ];
22
+ exports.default = nodeRecommendedConfig;
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("../../rules/react"));
7
- const react_a11y_1 = __importDefault(require("../../rules/react-a11y"));
8
7
  const react_hooks_1 = __importDefault(require("../../rules/react-hooks"));
8
+ const react_jsx_a11y_1 = __importDefault(require("../../rules/react-jsx-a11y"));
9
9
  const reactConfig = {
10
10
  react: react_1.default,
11
- reactA11y: react_a11y_1.default,
11
+ reactJsxA11y: react_jsx_a11y_1.default,
12
12
  reactHooks: react_hooks_1.default,
13
13
  };
14
14
  exports.default = reactConfig;
@@ -3,12 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const index_1 = __importDefault(require("../../configs/react/index"));
6
+ const react_1 = __importDefault(require("../../configs/react"));
7
+ const style_1 = __importDefault(require("../../rules/style"));
7
8
  const utils_1 = require("../../utils");
9
+ const dangleRules = style_1.default.rules['no-underscore-dangle'];
8
10
  const reactRecommendedConfig = [
9
- ...Object.values(index_1.default),
11
+ ...Object.values(react_1.default),
10
12
  {
11
- name: 'airbnb/config/react-settings',
13
+ name: 'airbnb/config/react-import-x',
12
14
  settings: {
13
15
  'import-x/resolver': {
14
16
  node: {
@@ -17,5 +19,43 @@ const reactRecommendedConfig = [
17
19
  },
18
20
  },
19
21
  },
22
+ {
23
+ name: 'airbnb/config/react-configurations',
24
+ rules: {
25
+ // Allow Redux devtools variable
26
+ 'no-underscore-dangle': [
27
+ dangleRules[0],
28
+ Object.assign(Object.assign({}, dangleRules[1]), { allow: [...dangleRules[1].allow, '__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'] }),
29
+ ],
30
+ // Specify whether double or single quotes should be used in JSX attributes
31
+ // https://eslint.org/docs/rules/jsx-quotes
32
+ // @deprecated
33
+ 'jsx-quotes': ['error', 'prefer-double'],
34
+ // Class Methods can be used in react
35
+ 'class-methods-use-this': [
36
+ 'error',
37
+ {
38
+ exceptMethods: [
39
+ 'render',
40
+ 'getInitialState',
41
+ 'getDefaultProps',
42
+ 'getChildContext',
43
+ 'componentWillMount',
44
+ 'UNSAFE_componentWillMount',
45
+ 'componentDidMount',
46
+ 'componentWillReceiveProps',
47
+ 'UNSAFE_componentWillReceiveProps',
48
+ 'shouldComponentUpdate',
49
+ 'componentWillUpdate',
50
+ 'UNSAFE_componentWillUpdate',
51
+ 'componentDidUpdate',
52
+ 'componentWillUnmount',
53
+ 'componentDidCatch',
54
+ 'getSnapshotBeforeUpdate',
55
+ ],
56
+ },
57
+ ],
58
+ },
59
+ },
20
60
  ];
21
61
  exports.default = reactRecommendedConfig;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const index_1 = __importDefault(require("../../configs/typescript/index"));
6
+ const typescript_1 = __importDefault(require("../../configs/typescript"));
7
7
  const utils_1 = require("../../utils");
8
8
  const react = [
9
9
  {
@@ -31,7 +31,7 @@ const react = [
31
31
  },
32
32
  ];
33
33
  const typescriptRecommendedConfig = {
34
- base: Object.values(index_1.default),
34
+ base: Object.values(typescript_1.default),
35
35
  react,
36
36
  next: react,
37
37
  };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ // eslint-disable-next-line import-x/no-namespace
37
+ const importXPlugin = __importStar(require("eslint-plugin-import-x"));
38
+ const importXPluginConfig = {
39
+ name: 'airbnb/config/plugin/import-x',
40
+ plugins: {
41
+ 'import-x': importXPlugin,
42
+ },
43
+ };
44
+ exports.default = importXPluginConfig;
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const importXPlugin_1 = __importDefault(require("../plugins/importXPlugin"));
6
7
  const nextPlugin_1 = __importDefault(require("../plugins/nextPlugin"));
8
+ const nodePlugin_1 = __importDefault(require("../plugins/nodePlugin"));
7
9
  const reactA11yPlugin_1 = __importDefault(require("../plugins/reactA11yPlugin"));
8
10
  const reactHooksPlugin_1 = __importDefault(require("../plugins/reactHooksPlugin"));
9
11
  const reactPlugin_1 = __importDefault(require("../plugins/reactPlugin"));
@@ -12,10 +14,12 @@ const typescriptEslintPlugin_1 = __importDefault(require("../plugins/typescriptE
12
14
  * as is given due to less size of index.d.ts
13
15
  */
14
16
  const plugins = {
15
- next: nextPlugin_1.default,
17
+ importX: importXPlugin_1.default,
18
+ node: nodePlugin_1.default,
16
19
  react: reactPlugin_1.default,
17
20
  reactA11y: reactA11yPlugin_1.default,
18
21
  reactHooks: reactHooksPlugin_1.default,
22
+ next: nextPlugin_1.default,
19
23
  typescriptEslint: typescriptEslintPlugin_1.default,
20
24
  };
21
25
  exports.default = plugins;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // @ts-expect-error eslint-plugin-import not working in import
4
4
  // eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
5
- const ESLintPluginNext = require('@next/eslint-plugin-next');
5
+ const plugin = require('@next/eslint-plugin-next');
6
6
  const nextPlugin = {
7
7
  name: 'airbnb/config/plugin/next',
8
8
  plugins: {
9
- '@next/next': ESLintPluginNext,
9
+ '@next/next': plugin,
10
10
  },
11
11
  };
12
12
  exports.default = nextPlugin;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
7
+ const nodePlugin = {
8
+ name: 'airbnb/config/plugin/node',
9
+ plugins: {
10
+ n: eslint_plugin_n_1.default,
11
+ },
12
+ };
13
+ exports.default = nodePlugin;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // @ts-expect-error eslint-plugin-import not working in import
4
4
  // eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
5
- const EsLintPluginJSXA11y = require('eslint-plugin-jsx-a11y');
5
+ const plugin = require('eslint-plugin-jsx-a11y');
6
6
  const reactA11yPlugin = {
7
7
  name: 'airbnb/config/plugin/react-a11y',
8
8
  plugins: {
9
- 'jsx-a11y': EsLintPluginJSXA11y,
9
+ 'jsx-a11y': plugin,
10
10
  },
11
11
  };
12
12
  exports.default = reactA11yPlugin;
@@ -34,11 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  // eslint-disable-next-line import-x/no-namespace
37
- const EsLintPluginReactHooks = __importStar(require("eslint-plugin-react-hooks"));
37
+ const plugin = __importStar(require("eslint-plugin-react-hooks"));
38
38
  const reactHooksPlugin = {
39
39
  name: 'airbnb/config/plugin/react-hooks',
40
40
  plugins: {
41
- 'react-hooks': EsLintPluginReactHooks,
41
+ 'react-hooks': plugin,
42
42
  },
43
43
  };
44
44
  exports.default = reactHooksPlugin;
@@ -3,17 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const eslint_plugin_import_x_1 = require("eslint-plugin-import-x");
6
+ exports.deprecatedImportsRules = void 0;
7
7
  const globals_1 = __importDefault(require("globals"));
8
8
  const getDevDepsList_1 = __importDefault(require("../helpers/getDevDepsList"));
9
9
  const utils_1 = require("../utils");
10
- const importsRules = Object.assign(Object.assign({}, eslint_plugin_import_x_1.flatConfigs.recommended), { name: 'airbnb/config/import-x', languageOptions: {
10
+ const importsRules = {
11
+ name: 'airbnb/config/import-x',
12
+ languageOptions: {
11
13
  globals: Object.assign({}, globals_1.default.es2015),
12
14
  parserOptions: {
13
- ecmaVersion: 6,
15
+ ecmaVersion: 2018,
14
16
  sourceType: 'module',
15
17
  },
16
- }, settings: {
18
+ },
19
+ settings: {
17
20
  'import-x/resolver': {
18
21
  node: {
19
22
  extensions: utils_1.jsExtensionsResolver,
@@ -22,7 +25,8 @@ const importsRules = Object.assign(Object.assign({}, eslint_plugin_import_x_1.fl
22
25
  'import-x/extensions': utils_1.jsExtensionsWithReact,
23
26
  'import-x/core-modules': [],
24
27
  'import-x/ignore': ['node_modules', String.raw `\.(coffee|scss|css|less|hbs|svg|json)$`],
25
- }, rules: {
28
+ },
29
+ rules: {
26
30
  // enforce a consistent style for type specifiers (inline or top-level)
27
31
  // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
28
32
  'import-x/consistent-type-specifier-style': 'off',
@@ -49,10 +53,6 @@ const importsRules = Object.assign(Object.assign({}, eslint_plugin_import_x_1.fl
49
53
  // in a single file.
50
54
  // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md
51
55
  'import-x/group-exports': 'off',
52
- // disallow non-import statements appearing before import statements
53
- // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md
54
- // @deprecated: use `import-x/first`
55
- // 'import-x/imports-first': 'off',
56
56
  // Forbid modules to have too many dependencies
57
57
  // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/max-dependencies.md
58
58
  'import-x/max-dependencies': 'off',
@@ -194,5 +194,14 @@ const importsRules = Object.assign(Object.assign({}, eslint_plugin_import_x_1.fl
194
194
  // this should not be enabled until this proposal has at least been *presented* to TC39.
195
195
  // At the moment, it's not a thing.
196
196
  'import-x/unambiguous': 'off',
197
- } });
197
+ },
198
+ };
199
+ exports.deprecatedImportsRules = {
200
+ name: 'airbnb/config/import-x/deprecated',
201
+ rules: {
202
+ // disallow non-import statements appearing before import statements
203
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md
204
+ 'import-x/imports-first': 'off',
205
+ },
206
+ };
198
207
  exports.default = importsRules;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const base_1 = __importDefault(require("../configs/base"));
7
7
  const next_1 = __importDefault(require("../configs/next"));
8
+ const node_1 = __importDefault(require("../configs/node"));
8
9
  const react_1 = __importDefault(require("../configs/react"));
9
10
  const typescript_1 = __importDefault(require("../configs/typescript"));
10
11
  const importsStrict_1 = __importDefault(require("../rules/importsStrict"));
@@ -15,6 +16,7 @@ const baseRules = Object.assign(Object.assign({}, base_1.default), { importsStri
15
16
  */
16
17
  const rules = {
17
18
  base: baseRules,
19
+ node: node_1.default,
18
20
  react: react_1.default,
19
21
  next: next_1.default,
20
22
  typescript: typescript_1.default,
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deprecatedNodeBaseRules = void 0;
4
+ const nodeBaseRules = {
5
+ name: 'airbnb/config/node/base',
6
+ rules: {
7
+ // Require return statements after callbacks
8
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
9
+ 'n/callback-return': 'off',
10
+ // Enforce either module.exports or exports
11
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md
12
+ 'n/exports-style': [
13
+ 'error',
14
+ 'module.exports',
15
+ {
16
+ allowBatchAssign: false,
17
+ },
18
+ ],
19
+ // Enforce the style of file extensions in import declarations
20
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md
21
+ // Off due to 'import-x/extensions'
22
+ 'n/file-extension-in-import': 'off',
23
+ // Require require() calls to be placed at top-level module scope
24
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md
25
+ 'n/global-require': 'error',
26
+ // Require error handling in callbacks
27
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md
28
+ 'n/handle-callback-err': 'off',
29
+ // Require correct usage of hashbang
30
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md
31
+ 'n/hashbang': 'error',
32
+ // Enforce Node.js-style error-first callback pattern is followed
33
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-callback-literal.md
34
+ 'n/no-callback-literal': 'off',
35
+ // Disallow deprecated APIs
36
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-deprecated-api.md
37
+ 'n/no-deprecated-api': 'error',
38
+ // Disallow the assignment to exports
39
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md
40
+ 'n/no-exports-assign': 'error',
41
+ // Disallow import declarations which import extraneous modules
42
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md
43
+ // Off due to 'import-x/no-extraneous-dependencies'
44
+ 'n/no-extraneous-import': 'off',
45
+ // Disallow require() expressions which import extraneous modules
46
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md
47
+ // Off due to 'import-x/no-extraneous-dependencies'
48
+ 'n/no-extraneous-require': 'off',
49
+ // Disallow import declarations which import non-existence modules
50
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md
51
+ // Off due to 'import-x/no-unresolved'
52
+ 'n/no-missing-import': 'off',
53
+ // Disallow require() expressions which import non-existence modules
54
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md
55
+ // Off due to 'import-x/no-unresolved'
56
+ 'n/no-missing-require': 'off',
57
+ // Disallow require calls to be mixed with regular variable declarations
58
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md
59
+ 'n/no-mixed-requires': 'off',
60
+ // Disallow new operators with calls to require
61
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md
62
+ 'n/no-new-require': 'error',
63
+ // Disallow string concatenation with __dirname and __filename
64
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md
65
+ 'n/no-path-concat': 'error',
66
+ // Disallow the use of process.env
67
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md
68
+ 'n/no-process-env': 'off',
69
+ // Disallow the use of process.exit()
70
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
71
+ 'n/no-process-exit': 'error',
72
+ // Disallow specified modules when loaded by import declarations
73
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
74
+ // Off due to 'no-restricted-imports'
75
+ 'n/no-restricted-import': 'off',
76
+ // Disallow specified modules when loaded by require
77
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md
78
+ // Off due to 'no-restricted-imports'
79
+ 'n/no-restricted-require': 'off',
80
+ // Disallow synchronous methods
81
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-sync.md
82
+ 'n/no-sync': [
83
+ 'error',
84
+ {
85
+ allowAtRootLevel: false,
86
+ ignores: [],
87
+ },
88
+ ],
89
+ // Disallow bin files that npm ignores
90
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-bin.md
91
+ 'n/no-unpublished-bin': 'error',
92
+ // Disallow import declarations which import private modules
93
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-import.md
94
+ // Off due to 'import-x/no-extraneous-dependencies'
95
+ 'n/no-unpublished-import': 'off',
96
+ // Disallow require() expressions which import private modules
97
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md
98
+ // Off due to 'import-x/no-extraneous-dependencies'
99
+ 'n/no-unpublished-require': 'off',
100
+ // Enforce using the node: protocol when importing Node.js builtin modules
101
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-node-protocol.md
102
+ 'n/prefer-node-protocol': 'error',
103
+ // Require that process.exit() expressions use the same code path as throw
104
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/process-exit-as-throw.md
105
+ 'n/process-exit-as-throw': 'error',
106
+ },
107
+ };
108
+ exports.deprecatedNodeBaseRules = {
109
+ name: 'airbnb/config/node/base/deprecated',
110
+ rules: {
111
+ // Disallow third-party modules which are hiding core modules
112
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-hide-core-modules.md
113
+ // @deprecated
114
+ 'n/no-hide-core-modules': 'off',
115
+ // Require correct usage of hashbang
116
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/shebang.md
117
+ // @deprecated
118
+ 'n/shebang': 'off',
119
+ },
120
+ };
121
+ exports.default = nodeBaseRules;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const nodeGlobalsRules = {
4
+ name: 'airbnb/config/node/globals',
5
+ rules: {
6
+ // Enforce either Buffer or require("buffer").Buffer
7
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md
8
+ 'n/prefer-global/buffer': ['error', 'always'],
9
+ // Enforce either console or require("console")
10
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/console.md
11
+ 'n/prefer-global/console': ['error', 'always'],
12
+ // Enforce either process or require("process")
13
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/process.md
14
+ 'n/prefer-global/process': ['error', 'always'],
15
+ // Enforce either TextDecoder or require("util").TextDecoder
16
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-decoder.md
17
+ 'n/prefer-global/text-decoder': ['error', 'always'],
18
+ // Enforce either TextEncoder or require("util").TextEncoder
19
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-encoder.md
20
+ 'n/prefer-global/text-encoder': ['error', 'always'],
21
+ // Enforce either URLSearchParams or require("url").URLSearchParams
22
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url-search-params.md
23
+ 'n/prefer-global/url-search-params': ['error', 'always'],
24
+ // Enforce either URL or require("url").URL
25
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url.md
26
+ 'n/prefer-global/url': ['error', 'always'],
27
+ },
28
+ };
29
+ exports.default = nodeGlobalsRules;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const nodeNoUnsupportedFeaturesRules = {
4
+ name: 'airbnb/config/node/unsupported-features',
5
+ rules: {
6
+ // Disallow unsupported ECMAScript built-ins on the specified version
7
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-builtins.md
8
+ 'n/no-unsupported-features/es-builtins': 'error',
9
+ // Disallow unsupported ECMAScript syntax on the specified version
10
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md
11
+ 'n/no-unsupported-features/es-syntax': 'error',
12
+ // Disallow unsupported Node.js built-in APIs on the specified version
13
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md
14
+ 'n/no-unsupported-features/node-builtins': 'error',
15
+ },
16
+ };
17
+ exports.default = nodeNoUnsupportedFeaturesRules;