eslint-config-airbnb-extended 0.8.0 → 0.9.1

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.
@@ -2,10 +2,10 @@
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" | "strict" | "style" | "stylistic" | "variables" | "importsStrict" | "reactStrict", import("eslint").Linter.Config>;
5
+ base: Record<"strict" | "imports" | "variables" | "bestPractices" | "errors" | "es6" | "style" | "stylistic" | "importsStrict" | "reactStrict", import("eslint").Linter.Config>;
6
6
  node: Record<"globals" | "base" | "promises" | "noUnsupportedFeatures", import("eslint").Linter.Config>;
7
7
  react: Record<"react" | "reactJsxA11y" | "reactHooks", import("eslint").Linter.Config>;
8
- next: Record<"next", import("eslint").Linter.Config>;
8
+ next: Record<"base" | "coreWebVitals", import("eslint").Linter.Config>;
9
9
  typescript: Record<"imports" | "base" | "typescriptEslint", import("eslint").Linter.Config>;
10
10
  };
11
11
  export declare const configs: {
@@ -0,0 +1,24 @@
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 best_practices_1 = __importDefault(require("../../rules/best-practices"));
7
+ const errors_1 = __importDefault(require("../../rules/errors"));
8
+ const es6_1 = __importDefault(require("../../rules/es6"));
9
+ const imports_1 = __importDefault(require("../../rules/imports"));
10
+ const strict_1 = __importDefault(require("../../rules/strict"));
11
+ const style_1 = __importDefault(require("../../rules/style"));
12
+ const stylistic_1 = __importDefault(require("../../rules/stylistic"));
13
+ const variables_1 = __importDefault(require("../../rules/variables"));
14
+ const baseConfig = {
15
+ bestPractices: best_practices_1.default,
16
+ errors: errors_1.default,
17
+ es6: es6_1.default,
18
+ imports: imports_1.default,
19
+ strict: strict_1.default,
20
+ style: style_1.default,
21
+ stylistic: stylistic_1.default,
22
+ variables: variables_1.default,
23
+ };
24
+ exports.default = baseConfig;
@@ -3,22 +3,11 @@ 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 best_practices_1 = __importDefault(require("../../rules/best-practices"));
7
- const errors_1 = __importDefault(require("../../rules/errors"));
8
- const es6_1 = __importDefault(require("../../rules/es6"));
9
- const imports_1 = __importDefault(require("../../rules/imports"));
10
- const strict_1 = __importDefault(require("../../rules/strict"));
11
- const style_1 = __importDefault(require("../../rules/style"));
12
- const stylistic_1 = __importDefault(require("../../rules/stylistic"));
13
- const variables_1 = __importDefault(require("../../rules/variables"));
14
- const baseConfig = {
15
- bestPractices: best_practices_1.default,
16
- errors: errors_1.default,
17
- es6: es6_1.default,
18
- imports: imports_1.default,
19
- strict: strict_1.default,
20
- style: style_1.default,
21
- stylistic: stylistic_1.default,
22
- variables: variables_1.default,
6
+ const recommended_1 = __importDefault(require("../../configs/base/recommended"));
7
+ const typescript_1 = __importDefault(require("../../configs/base/typescript"));
8
+ const base = {
9
+ recommended: recommended_1.default,
10
+ typescript: typescript_1.default,
11
+ all: [...recommended_1.default, ...typescript_1.default],
23
12
  };
24
- exports.default = baseConfig;
13
+ exports.default = base;
@@ -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 base_1 = __importDefault(require("../../configs/base"));
6
+ const config_1 = __importDefault(require("../../configs/base/config"));
7
7
  const baseRecommendedConfig = [
8
- ...Object.values(base_1.default),
8
+ ...Object.values(config_1.default),
9
9
  {
10
10
  name: 'airbnb/config/language-configurations',
11
11
  languageOptions: {
@@ -0,0 +1,8 @@
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 config_1 = __importDefault(require("../../configs/typescript/config"));
7
+ const baseTypescriptConfig = Object.values(config_1.default);
8
+ exports.default = baseTypescriptConfig;
@@ -3,36 +3,17 @@ 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 recommended_1 = __importDefault(require("../configs/base/recommended"));
7
- const recommended_2 = __importDefault(require("../configs/next/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"));
11
- const base = {
12
- recommended: recommended_1.default,
13
- typescript: recommended_5.default.base,
14
- all: [...recommended_1.default, ...recommended_5.default.base],
15
- };
16
- const react = {
17
- recommended: recommended_4.default,
18
- typescript: recommended_5.default.react,
19
- all: [...recommended_4.default, ...recommended_5.default.react],
20
- };
21
- const next = {
22
- recommended: recommended_2.default,
23
- typescript: recommended_5.default.next,
24
- all: [...recommended_2.default, ...recommended_5.default.next],
25
- };
26
- const node = {
27
- recommended: recommended_3.default,
28
- };
6
+ const base_1 = __importDefault(require("../configs/base"));
7
+ const next_1 = __importDefault(require("../configs/next"));
8
+ const node_1 = __importDefault(require("../configs/node"));
9
+ const react_1 = __importDefault(require("../configs/react"));
29
10
  /**
30
11
  * as is given due to less size of index.d.ts
31
12
  */
32
13
  const configs = {
33
- base: base,
34
- react: react,
35
- next: next,
36
- node: node,
14
+ base: base_1.default,
15
+ react: react_1.default,
16
+ next: next_1.default,
17
+ node: node_1.default,
37
18
  };
38
19
  exports.default = configs;
@@ -0,0 +1,12 @@
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 nextBase_1 = __importDefault(require("../../rules/next/nextBase"));
7
+ const nextCoreWebVitals_1 = __importDefault(require("../../rules/next/nextCoreWebVitals"));
8
+ const nextConfig = {
9
+ base: nextBase_1.default,
10
+ coreWebVitals: nextCoreWebVitals_1.default,
11
+ };
12
+ exports.default = nextConfig;
@@ -3,8 +3,11 @@ 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 next_1 = __importDefault(require("../../rules/next"));
7
- const nextConfig = {
8
- next: next_1.default,
6
+ const recommended_1 = __importDefault(require("../../configs/next/recommended"));
7
+ const typescript_1 = __importDefault(require("../../configs/next/typescript"));
8
+ const next = {
9
+ recommended: recommended_1.default,
10
+ typescript: typescript_1.default,
11
+ all: [...recommended_1.default, ...typescript_1.default],
9
12
  };
10
- exports.default = nextConfig;
13
+ exports.default = next;
@@ -3,11 +3,11 @@ 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 next_1 = __importDefault(require("../../configs/next"));
6
+ const config_1 = __importDefault(require("../../configs/next/config"));
7
7
  const recommended_1 = __importDefault(require("../../configs/react/recommended"));
8
8
  const nextRecommendedConfig = [
9
9
  ...recommended_1.default,
10
- ...Object.values(next_1.default),
10
+ ...Object.values(config_1.default),
11
11
  {
12
12
  name: 'airbnb/config/next-import-x',
13
13
  files: ['**/app/**/route.ts', '**/middleware.ts'],
@@ -0,0 +1,8 @@
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 typescript_1 = __importDefault(require("../../configs/react/typescript"));
7
+ const nextTypescriptConfig = typescript_1.default;
8
+ exports.default = nextTypescriptConfig;
@@ -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;
@@ -3,14 +3,8 @@ 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 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,
6
+ const recommended_1 = __importDefault(require("../../configs/node/recommended"));
7
+ const node = {
8
+ recommended: recommended_1.default,
15
9
  };
16
- exports.default = nodeConfig;
10
+ exports.default = node;
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  var _a, _b;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
8
- const node_1 = __importDefault(require("../../configs/node"));
8
+ const config_1 = __importDefault(require("../../configs/node/config"));
9
9
  const nodeNoUnsupportedFeatures_1 = __importDefault(require("../../rules/node/nodeNoUnsupportedFeatures"));
10
10
  const flatNodeConfig = eslint_plugin_n_1.default.configs['flat/recommended'];
11
11
  const nodeRecommendedConfig = [
12
- ...Object.values(node_1.default),
12
+ ...Object.values(config_1.default),
13
13
  Object.assign({ name: 'airbnb/config/node-configurations' }, (flatNodeConfig
14
14
  ? {
15
15
  languageOptions: flatNodeConfig.languageOptions,
@@ -0,0 +1,14 @@
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 react_1 = __importDefault(require("../../rules/react"));
7
+ const react_hooks_1 = __importDefault(require("../../rules/react-hooks"));
8
+ const react_jsx_a11y_1 = __importDefault(require("../../rules/react-jsx-a11y"));
9
+ const reactConfig = {
10
+ react: react_1.default,
11
+ reactJsxA11y: react_jsx_a11y_1.default,
12
+ reactHooks: react_hooks_1.default,
13
+ };
14
+ exports.default = reactConfig;
@@ -3,12 +3,11 @@ 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 react_1 = __importDefault(require("../../rules/react"));
7
- const react_hooks_1 = __importDefault(require("../../rules/react-hooks"));
8
- const react_jsx_a11y_1 = __importDefault(require("../../rules/react-jsx-a11y"));
9
- const reactConfig = {
10
- react: react_1.default,
11
- reactJsxA11y: react_jsx_a11y_1.default,
12
- reactHooks: react_hooks_1.default,
6
+ const recommended_1 = __importDefault(require("../../configs/react/recommended"));
7
+ const typescript_1 = __importDefault(require("../../configs/react/typescript"));
8
+ const react = {
9
+ recommended: recommended_1.default,
10
+ typescript: typescript_1.default,
11
+ all: [...recommended_1.default, ...typescript_1.default],
13
12
  };
14
- exports.default = reactConfig;
13
+ exports.default = react;
@@ -3,12 +3,12 @@ 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 react_1 = __importDefault(require("../../configs/react"));
6
+ const config_1 = __importDefault(require("../../configs/react/config"));
7
7
  const style_1 = __importDefault(require("../../rules/style"));
8
8
  const utils_1 = require("../../utils");
9
9
  const dangleRules = style_1.default.rules['no-underscore-dangle'];
10
10
  const reactRecommendedConfig = [
11
- ...Object.values(react_1.default),
11
+ ...Object.values(config_1.default),
12
12
  {
13
13
  name: 'airbnb/config/react-import-x',
14
14
  settings: {
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const typescript_1 = __importDefault(require("../../configs/typescript"));
7
3
  const utils_1 = require("../../utils");
8
- const react = [
4
+ const reactTypescriptConfig = [
9
5
  {
10
6
  name: 'airbnb/config/typescript-react',
11
7
  rules: {
@@ -30,9 +26,4 @@ const react = [
30
26
  },
31
27
  },
32
28
  ];
33
- const typescriptRecommendedConfig = {
34
- base: Object.values(typescript_1.default),
35
- react,
36
- next: react,
37
- };
38
- exports.default = typescriptRecommendedConfig;
29
+ exports.default = reactTypescriptConfig;
@@ -1,44 +1,13 @@
1
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
- })();
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
35
5
  Object.defineProperty(exports, "__esModule", { value: true });
36
- // eslint-disable-next-line import-x/no-namespace
37
- const importXPlugin = __importStar(require("eslint-plugin-import-x"));
6
+ const eslint_plugin_import_x_1 = __importDefault(require("eslint-plugin-import-x"));
38
7
  const importXPluginConfig = {
39
8
  name: 'airbnb/config/plugin/import-x',
40
9
  plugins: {
41
- 'import-x': importXPlugin,
10
+ 'import-x': eslint_plugin_import_x_1.default,
42
11
  },
43
12
  };
44
13
  exports.default = importXPluginConfig;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // @ts-expect-error eslint-plugin-import not working in import
4
- // eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
5
- const plugin = require('eslint-plugin-jsx-a11y');
6
+ const eslint_plugin_jsx_a11y_1 = __importDefault(require("eslint-plugin-jsx-a11y"));
6
7
  const reactA11yPlugin = {
7
8
  name: 'airbnb/config/plugin/react-a11y',
8
9
  plugins: {
9
- 'jsx-a11y': plugin,
10
+ 'jsx-a11y': eslint_plugin_jsx_a11y_1.default,
10
11
  },
11
12
  };
12
13
  exports.default = reactA11yPlugin;
@@ -1,44 +1,13 @@
1
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
- })();
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
35
5
  Object.defineProperty(exports, "__esModule", { value: true });
36
- // eslint-disable-next-line import-x/no-namespace
37
- const plugin = __importStar(require("eslint-plugin-react-hooks"));
6
+ const eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
38
7
  const reactHooksPlugin = {
39
8
  name: 'airbnb/config/plugin/react-hooks',
40
9
  plugins: {
41
- 'react-hooks': plugin,
10
+ 'react-hooks': eslint_plugin_react_hooks_1.default,
42
11
  },
43
12
  };
44
13
  exports.default = reactHooksPlugin;
@@ -3,22 +3,22 @@ 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 base_1 = __importDefault(require("../configs/base"));
7
- const next_1 = __importDefault(require("../configs/next"));
8
- const node_1 = __importDefault(require("../configs/node"));
9
- const react_1 = __importDefault(require("../configs/react"));
10
- const typescript_1 = __importDefault(require("../configs/typescript"));
6
+ const config_1 = __importDefault(require("../configs/base/config"));
7
+ const config_2 = __importDefault(require("../configs/next/config"));
8
+ const config_3 = __importDefault(require("../configs/node/config"));
9
+ const config_4 = __importDefault(require("../configs/react/config"));
10
+ const config_5 = __importDefault(require("../configs/typescript/config"));
11
11
  const importsStrict_1 = __importDefault(require("../rules/importsStrict"));
12
12
  const reactStrict_1 = __importDefault(require("../rules/reactStrict"));
13
- const baseRules = Object.assign(Object.assign({}, base_1.default), { importsStrict: importsStrict_1.default, reactStrict: reactStrict_1.default });
13
+ const baseRules = Object.assign(Object.assign({}, config_1.default), { importsStrict: importsStrict_1.default, reactStrict: reactStrict_1.default });
14
14
  /**
15
15
  * as is given due to less size of index.d.ts
16
16
  */
17
17
  const rules = {
18
18
  base: baseRules,
19
- node: node_1.default,
20
- react: react_1.default,
21
- next: next_1.default,
22
- typescript: typescript_1.default,
19
+ node: config_3.default,
20
+ react: config_4.default,
21
+ next: config_2.default,
22
+ typescript: config_5.default,
23
23
  };
24
24
  exports.default = rules;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const nextBaseRules = {
4
+ name: 'airbnb/config/next/base',
5
+ rules: {
6
+ // Enforce font-display behavior with Google Fonts.
7
+ // https://nextjs.org/docs/messages/google-font-display
8
+ '@next/next/google-font-display': 'warn',
9
+ // Ensure preconnect is used with Google Fonts.
10
+ // https://nextjs.org/docs/messages/google-font-preconnect
11
+ '@next/next/google-font-preconnect': 'warn',
12
+ // Enforce id attribute on next/script components with inline content.
13
+ // https://nextjs.org/docs/messages/inline-script-id
14
+ '@next/next/inline-script-id': 'error',
15
+ // Prefer next/script component when using the inline script for Google Analytics.
16
+ // https://nextjs.org/docs/messages/next-script-for-ga
17
+ '@next/next/next-script-for-ga': 'warn',
18
+ // Prevent assignment to the module variable.
19
+ // https://nextjs.org/docs/messages/no-assign-module-variable
20
+ '@next/next/no-assign-module-variable': 'error',
21
+ // Prevent client components from being async functions.
22
+ // https://nextjs.org/docs/messages/no-async-client-component
23
+ '@next/next/no-async-client-component': 'warn',
24
+ // Prevent usage of next/script's beforeInteractive strategy outside of pages/_document.js.
25
+ // https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
26
+ '@next/next/no-before-interactive-script-outside-document': 'warn',
27
+ // Prevent manual stylesheet tags.
28
+ // https://nextjs.org/docs/messages/no-css-tags
29
+ '@next/next/no-css-tags': 'warn',
30
+ // Prevent importing next/document outside of pages/_document.js.
31
+ // https://nextjs.org/docs/messages/no-document-import-in-page
32
+ '@next/next/no-document-import-in-page': 'error',
33
+ // Prevent duplicate usage of <Head> in pages/_document.js.
34
+ // https://nextjs.org/docs/messages/no-duplicate-head
35
+ '@next/next/no-duplicate-head': 'error',
36
+ // Prevent usage of <head> element.
37
+ // https://nextjs.org/docs/messages/no-head-element
38
+ '@next/next/no-head-element': 'warn',
39
+ // Prevent usage of next/head in pages/_document.js.
40
+ // https://nextjs.org/docs/messages/no-head-import-in-document
41
+ '@next/next/no-head-import-in-document': 'error',
42
+ // Prevent usage of <a> elements to navigate to internal Next.js pages.
43
+ // https://nextjs.org/docs/messages/no-html-link-for-pages
44
+ '@next/next/no-html-link-for-pages': 'warn',
45
+ // Prevent usage of <img> element due to slower LCP and higher bandwidth.
46
+ // https://nextjs.org/docs/messages/no-img-element
47
+ '@next/next/no-img-element': 'warn',
48
+ // Prevent page-only custom fonts.
49
+ // https://nextjs.org/docs/messages/no-page-custom-font
50
+ '@next/next/no-page-custom-font': 'warn',
51
+ // Prevent usage of next/script in next/head component.
52
+ // https://nextjs.org/docs/messages/no-script-component-in-head
53
+ '@next/next/no-script-component-in-head': 'error',
54
+ // Prevent usage of styled-jsx in pages/_document.js.
55
+ // https://nextjs.org/docs/messages/no-styled-jsx-in-document
56
+ '@next/next/no-styled-jsx-in-document': 'warn',
57
+ // Prevent synchronous scripts.
58
+ // https://nextjs.org/docs/messages/no-sync-scripts
59
+ '@next/next/no-sync-scripts': 'warn',
60
+ // Prevent usage of <title> with Head component from next/document.
61
+ // https://nextjs.org/docs/messages/no-title-in-document-head
62
+ '@next/next/no-title-in-document-head': 'warn',
63
+ // Prevent common typos in Next.js's data fetching functions
64
+ // https://nextjs.org/docs/pages/building-your-application/data-fetching
65
+ '@next/next/no-typos': 'warn',
66
+ // Prevent duplicate polyfills from Polyfill.io.
67
+ // https://nextjs.org/docs/messages/no-unwanted-polyfillio
68
+ '@next/next/no-unwanted-polyfillio': 'warn',
69
+ },
70
+ };
71
+ exports.default = nextBaseRules;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const nextCoreWebVitalsRules = {
4
+ name: 'airbnb/config/next/core-web-vitals',
5
+ rules: {
6
+ // Prevent usage of `<a>` elements to navigate to internal Next.js pages.
7
+ '@next/next/no-html-link-for-pages': 'error',
8
+ // Prevent synchronous scripts.
9
+ '@next/next/no-sync-scripts': 'error',
10
+ },
11
+ };
12
+ exports.default = nextCoreWebVitalsRules;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-airbnb-extended",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "Eslint Airbnb Config Extended",
5
5
  "keywords": [
6
6
  "eslint",
@@ -36,22 +36,15 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/confusing-browser-globals": "^1.0.3",
39
- "@types/eslint-plugin-jsx-a11y": "^6.10.0",
40
- "eslint": "^9.24.0",
41
- "eslint-import-resolver-typescript": "^4.3.1",
42
- "eslint-plugin-import-x": "^4.10.2",
43
- "eslint-plugin-jsx-a11y": "^6.10.2",
44
- "eslint-plugin-n": "^17.17.0",
45
- "eslint-plugin-react": "^7.37.5",
46
- "eslint-plugin-react-hooks": "^5.2.0",
47
39
  "ts-node": "^10.9.2",
48
- "tsc-alias": "^1.8.14",
40
+ "tsc-alias": "^1.8.15",
49
41
  "tsconfig-paths": "^4.2.0",
50
42
  "typescript": "^5.8.3",
51
43
  "typescript-eslint": "^8.29.1"
52
44
  },
53
45
  "peerDependencies": {
54
46
  "@next/eslint-plugin-next": "^15.2.4",
47
+ "@types/eslint-plugin-jsx-a11y": "^6.10.0",
55
48
  "eslint": "9.x",
56
49
  "eslint-import-resolver-typescript": "^4.3.1",
57
50
  "eslint-plugin-import-x": "4.x",
@@ -65,11 +58,17 @@
65
58
  "@next/eslint-plugin-next": {
66
59
  "optional": true
67
60
  },
68
- "eslint-import-resolver-typescript": {
61
+ "@types/eslint-plugin-jsx-a11y": {
69
62
  "optional": true
70
63
  },
64
+ "eslint": {
65
+ "optional": false
66
+ },
67
+ "eslint-import-resolver-typescript": {
68
+ "optional": false
69
+ },
71
70
  "eslint-plugin-jsx-a11y": {
72
- "optional": true
71
+ "optional": false
73
72
  },
74
73
  "eslint-plugin-n": {
75
74
  "optional": true
@@ -85,7 +84,7 @@
85
84
  }
86
85
  },
87
86
  "scripts": {
88
- "prebuild": "pnpm check:updates",
87
+ "prebuild": "pnpm check:updates && rm -rf ./dist",
89
88
  "build": "tsc -b",
90
89
  "postbuild": "tsc-alias",
91
90
  "check:updates": "ts-node script/checkUpdates.ts",
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // @ts-expect-error eslint-plugin-import not working in import
4
- // eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
5
- const ESLintPluginNext = require('@next/eslint-plugin-next');
6
- const nextRules = {
7
- name: 'airbnb/config/next',
8
- rules: Object.assign(Object.assign({}, ESLintPluginNext.configs.recommended.rules), ESLintPluginNext.configs['core-web-vitals'].rules),
9
- };
10
- exports.default = nextRules;
@@ -1,259 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deprecatedReactA11yRules = void 0;
4
- const reactA11yRules = {
5
- name: 'airbnb/config/react-a11y',
6
- languageOptions: {
7
- parserOptions: {
8
- ecmaFeatures: {
9
- jsx: true,
10
- },
11
- },
12
- },
13
- rules: {
14
- // Enforce that all elements that require alternative text have meaningful information
15
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md
16
- 'jsx-a11y/alt-text': [
17
- 'error',
18
- {
19
- elements: ['img', 'object', 'area', 'input[type="image"]'],
20
- img: [],
21
- object: [],
22
- area: [],
23
- 'input[type="image"]': [],
24
- },
25
- ],
26
- // Ensures anchor text is not ambiguous
27
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md
28
- 'jsx-a11y/anchor-ambiguous-text': 'off',
29
- // Enforce that anchors have content
30
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md
31
- 'jsx-a11y/anchor-has-content': [
32
- 'error',
33
- {
34
- components: [],
35
- },
36
- ],
37
- // ensure <a> tags are valid
38
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md
39
- 'jsx-a11y/anchor-is-valid': [
40
- 'error',
41
- {
42
- components: ['Link'],
43
- specialLink: ['to'],
44
- aspects: ['noHref', 'invalidHref', 'preferButton'],
45
- },
46
- ],
47
- // elements with aria-activedescendant must be tabbable
48
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md
49
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
50
- // Enforce all aria-* props are valid.
51
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md
52
- 'jsx-a11y/aria-props': 'error',
53
- // Enforce ARIA state and property values are valid.
54
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md
55
- 'jsx-a11y/aria-proptypes': 'error',
56
- // Require ARIA roles to be valid and non-abstract
57
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md
58
- 'jsx-a11y/aria-role': [
59
- 'error',
60
- {
61
- ignoreNonDOM: false,
62
- },
63
- ],
64
- // Enforce that elements that do not support ARIA roles, states, and
65
- // properties do not have those attributes.
66
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md
67
- 'jsx-a11y/aria-unsupported-elements': 'error',
68
- // Ensure the autocomplete attribute is correct and suitable for the form field it is used with
69
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md
70
- 'jsx-a11y/autocomplete-valid': [
71
- 'error',
72
- {
73
- inputComponents: ['Input'],
74
- },
75
- ],
76
- // require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
77
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md
78
- 'jsx-a11y/click-events-have-key-events': 'error',
79
- // Enforce that a control (an interactive element) has a text label.
80
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md
81
- 'jsx-a11y/control-has-associated-label': [
82
- 'error',
83
- {
84
- labelAttributes: ['label'],
85
- controlComponents: [],
86
- ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
87
- ignoreRoles: [
88
- 'grid',
89
- 'listbox',
90
- 'menu',
91
- 'menubar',
92
- 'radiogroup',
93
- 'row',
94
- 'tablist',
95
- 'toolbar',
96
- 'tree',
97
- 'treegrid',
98
- ],
99
- depth: 5,
100
- },
101
- ],
102
- // ensure <hX> tags have content and are not aria-hidden
103
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md
104
- 'jsx-a11y/heading-has-content': [
105
- 'error',
106
- {
107
- components: ['Typography', 'Text'],
108
- },
109
- ],
110
- // require HTML elements to have a "lang" prop
111
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md
112
- 'jsx-a11y/html-has-lang': 'error',
113
- // ensure iframe elements have a unique title
114
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md
115
- 'jsx-a11y/iframe-has-title': 'error',
116
- // Prevent img alt text from containing redundant words like "image", "picture", or "photo"
117
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md
118
- 'jsx-a11y/img-redundant-alt': 'error',
119
- // Elements with an interactive role and interaction handlers must be focusable
120
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md
121
- 'jsx-a11y/interactive-supports-focus': 'error',
122
- // Enforce that a label tag has a text label and an associated control.
123
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md
124
- 'jsx-a11y/label-has-associated-control': [
125
- 'error',
126
- {
127
- labelComponents: [],
128
- labelAttributes: [],
129
- controlComponents: [],
130
- assert: 'both',
131
- depth: 25,
132
- },
133
- ],
134
- // require HTML element's lang prop to be valid
135
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md
136
- 'jsx-a11y/lang': 'error',
137
- // media elements must have captions
138
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md
139
- 'jsx-a11y/media-has-caption': [
140
- 'error',
141
- {
142
- audio: [],
143
- video: [],
144
- track: [],
145
- },
146
- ],
147
- // require that mouseover/outcome with focus/blur, for keyboard-only users
148
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md
149
- 'jsx-a11y/mouse-events-have-key-events': 'error',
150
- // Prevent use of `accessKey`
151
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md
152
- 'jsx-a11y/no-access-key': 'error',
153
- // Enforce that aria-hidden="true" is not set on focusable elements.
154
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md
155
- 'jsx-a11y/no-aria-hidden-on-focusable': 'off',
156
- // prohibit autoFocus prop
157
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md
158
- 'jsx-a11y/no-autofocus': [
159
- 'error',
160
- {
161
- ignoreNonDOM: true,
162
- },
163
- ],
164
- // prevent distracting elements, like <marquee> and <blink>
165
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
166
- 'jsx-a11y/no-distracting-elements': [
167
- 'error',
168
- {
169
- elements: ['marquee', 'blink'],
170
- },
171
- ],
172
- // WAI-ARIA roles should not be used to convert an interactive element to non-interactive
173
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md
174
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
175
- 'error',
176
- {
177
- tr: ['none', 'presentation'],
178
- },
179
- ],
180
- // A non-interactive element does not support event handlers (mouse and key handlers)
181
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md
182
- 'jsx-a11y/no-noninteractive-element-interactions': [
183
- 'error',
184
- {
185
- handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
186
- },
187
- ],
188
- // WAI-ARIA roles should not be used to convert a non-interactive element to interactive
189
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md
190
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
191
- 'error',
192
- {
193
- ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
194
- ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
195
- li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
196
- table: ['grid'],
197
- td: ['gridcell'],
198
- },
199
- ],
200
- // Tab key navigation should be limited to elements on the page that can be interacted with.
201
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md
202
- 'jsx-a11y/no-noninteractive-tabindex': [
203
- 'error',
204
- {
205
- tags: [],
206
- roles: ['tabpanel'],
207
- allowExpressionValues: true,
208
- },
209
- ],
210
- // ensure HTML elements do not specify redundant ARIA roles
211
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md
212
- 'jsx-a11y/no-redundant-roles': [
213
- 'error',
214
- {
215
- nav: ['navigation'],
216
- },
217
- ],
218
- // Enforce that DOM elements without semantic behavior not have interaction handlers
219
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md
220
- 'jsx-a11y/no-static-element-interactions': [
221
- 'error',
222
- {
223
- handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
224
- },
225
- ],
226
- // Enforces using semantic DOM elements over the ARIA role property.
227
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md
228
- 'jsx-a11y/prefer-tag-over-role': 'off',
229
- // Enforce that elements with ARIA roles must have all required attributes
230
- // for that role.
231
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md
232
- 'jsx-a11y/role-has-required-aria-props': 'error',
233
- // Enforce that elements with explicit or implicit roles defined contain
234
- // only aria-* properties supported by that role.
235
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md
236
- 'jsx-a11y/role-supports-aria-props': 'error',
237
- // only allow <th> to have the "scope" attr
238
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md
239
- 'jsx-a11y/scope': 'error',
240
- // Enforce tabIndex value is not greater than zero.
241
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md
242
- 'jsx-a11y/tabindex-no-positive': 'error',
243
- },
244
- };
245
- exports.deprecatedReactA11yRules = {
246
- name: 'airbnb/config/react-a11y/deprecated',
247
- rules: {
248
- // ensure emoji are accessible
249
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md
250
- 'jsx-a11y/accessible-emoji': 'off',
251
- // require that JSX labels use "htmlFor"
252
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md
253
- 'jsx-a11y/label-has-for': 'off',
254
- // require onBlur instead of onChange
255
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-onchange.md
256
- 'jsx-a11y/no-onchange': 'off',
257
- },
258
- };
259
- exports.default = reactA11yRules;
@@ -1,114 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- const eslint_plugin_import_x_1 = __importDefault(require("eslint-plugin-import-x"));
49
- const eslint_plugin_jsx_a11y_1 = __importDefault(require("eslint-plugin-jsx-a11y"));
50
- const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
51
- const eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
52
- const eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
53
- const imports_1 = __importStar(require("../rules/imports"));
54
- const nodeBase_1 = __importStar(require("../rules/node/nodeBase"));
55
- const nodeGlobals_1 = __importDefault(require("../rules/node/nodeGlobals"));
56
- const nodeNoUnsupportedFeatures_1 = __importDefault(require("../rules/node/nodeNoUnsupportedFeatures"));
57
- const nodePromises_1 = __importDefault(require("../rules/node/nodePromises"));
58
- const react_1 = __importStar(require("../rules/react"));
59
- const react_hooks_1 = __importDefault(require("../rules/react-hooks"));
60
- const react_jsx_a11y_1 = __importStar(require("../rules/react-jsx-a11y"));
61
- const getRulesArray = (prefix, arr) => arr.filter((rule) => rule.startsWith(prefix));
62
- const checkImportsUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
63
- const localRules = getRulesArray('import-x/', Object.keys(imports_1.default.rules));
64
- const deprecatedLocalRules = getRulesArray('import-x/', Object.keys(imports_1.deprecatedImportsRules.rules));
65
- const remoteRules = Object.keys(eslint_plugin_import_x_1.default.rules);
66
- if (localRules.length + deprecatedLocalRules.length === remoteRules.length)
67
- return true;
68
- throw new Error('Import X Plugin Updated');
69
- });
70
- const checkNodeUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
71
- const localRules = getRulesArray('n/', [
72
- ...Object.keys(nodeBase_1.default.rules),
73
- ...Object.keys(nodeGlobals_1.default.rules),
74
- ...Object.keys(nodePromises_1.default.rules),
75
- ...Object.keys(nodeNoUnsupportedFeatures_1.default.rules),
76
- ]);
77
- const deprecatedLocalRules = getRulesArray('n/', Object.keys(nodeBase_1.deprecatedNodeBaseRules.rules));
78
- const remoteRules = eslint_plugin_n_1.default.rules ? Object.keys(eslint_plugin_n_1.default.rules) : [];
79
- if (localRules.length + deprecatedLocalRules.length === remoteRules.length)
80
- return true;
81
- throw new Error('Node Plugin Updated');
82
- });
83
- const checkReactUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
84
- const localRules = getRulesArray('react/', Object.keys(react_1.default.rules));
85
- const deprecatedLocalRules = getRulesArray('react/', Object.keys(react_1.deprecatedReactRules.rules));
86
- const remoteRules = Object.keys(eslint_plugin_react_1.default.rules);
87
- if (localRules.length + deprecatedLocalRules.length === remoteRules.length)
88
- return true;
89
- throw new Error('React Plugin Updated');
90
- });
91
- const checkReactJsxA11yUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
92
- const localRules = getRulesArray('jsx-a11y/', Object.keys(react_jsx_a11y_1.default.rules));
93
- const deprecatedLocalRules = getRulesArray('jsx-a11y/', Object.keys(react_jsx_a11y_1.deprecatedReactJsxA11yRules.rules));
94
- const remoteRules = eslint_plugin_jsx_a11y_1.default.rules ? Object.keys(eslint_plugin_jsx_a11y_1.default.rules) : [];
95
- if (localRules.length + deprecatedLocalRules.length === remoteRules.length)
96
- return true;
97
- throw new Error('React JSX A11y Plugin Updated');
98
- });
99
- const checkReactHooksUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
100
- const localRules = getRulesArray('react-hooks/', Object.keys(react_hooks_1.default.rules));
101
- const remoteRules = Object.keys(eslint_plugin_react_hooks_1.default.rules);
102
- if (localRules.length === remoteRules.length)
103
- return true;
104
- throw new Error('React Hooks Plugin Updated');
105
- });
106
- const checkUpdates = () => __awaiter(void 0, void 0, void 0, function* () {
107
- yield checkImportsUpdates();
108
- yield checkNodeUpdates();
109
- yield checkReactUpdates();
110
- yield checkReactJsxA11yUpdates();
111
- yield checkReactHooksUpdates();
112
- });
113
- // noinspection JSIgnoredPromiseFromCall
114
- checkUpdates();
File without changes