eslint-config-airbnb-extended 0.11.3 → 1.0.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 +43 -0
- package/dist/configs/base/recommended.js +14 -2
- package/dist/configs/base/typescript.js +7 -12
- package/dist/configs/next/recommended.js +2 -0
- package/dist/configs/node/recommended.js +2 -1
- package/dist/configs/react/recommended.js +7 -9
- package/dist/configs/react/typescript.js +8 -8
- package/dist/helpers/getImportSettings.js +42 -0
- package/dist/plugins/importXPlugin.js +2 -0
- package/dist/plugins/nextPlugin.js +2 -0
- package/dist/plugins/nodePlugin.js +2 -0
- package/dist/plugins/reactA11yPlugin.js +2 -0
- package/dist/plugins/reactHooksPlugin.js +2 -0
- package/dist/plugins/reactPlugin.js +2 -0
- package/dist/plugins/stylisticPlugin.js +2 -0
- package/dist/plugins/typescriptEslintPlugin.js +2 -0
- package/dist/rules/best-practices.js +2 -0
- package/dist/rules/errors.js +2 -0
- package/dist/rules/es6.js +2 -0
- package/dist/rules/imports.js +2 -10
- package/dist/rules/importsStrict.js +2 -0
- package/dist/rules/next/nextBase.js +2 -0
- package/dist/rules/next/nextCoreWebVitals.js +2 -0
- package/dist/rules/node/nodeBase.js +3 -0
- package/dist/rules/node/nodeGlobals.js +2 -0
- package/dist/rules/node/nodeNoUnsupportedFeatures.js +2 -0
- package/dist/rules/node/nodePromises.js +2 -0
- package/dist/rules/react/react.js +3 -0
- package/dist/rules/react/reactHooks.js +2 -0
- package/dist/rules/react/reactJsxA11y.js +3 -0
- package/dist/rules/react/reactStrict.js +2 -0
- package/dist/rules/react/reactStylistic.js +3 -0
- package/dist/rules/strict.js +2 -0
- package/dist/rules/style.js +2 -0
- package/dist/rules/stylistic.js +3 -0
- package/dist/rules/stylisticPlus.js +2 -0
- package/dist/rules/typescript/typescriptBase.js +2 -0
- package/dist/rules/typescript/typescriptEslint.js +3 -0
- package/dist/rules/typescript/typescriptImports.js +1 -16
- package/dist/rules/typescript/typescriptStylistic.js +3 -0
- package/dist/rules/typescript/typescriptStylisticPlus.js +2 -0
- package/dist/rules/variables.js +2 -0
- package/dist/utils/index.js +6 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,6 +46,49 @@ This configuration relies on the following essential packages:
|
|
|
46
46
|
- **`typescript-eslint`**: Provides linting support for TypeScript codebases.
|
|
47
47
|
- **`eslint-import-resolver-typescript`**: Ensures TypeScript compatibility for import statements.
|
|
48
48
|
|
|
49
|
+
## Strict Rules
|
|
50
|
+
|
|
51
|
+
The `eslint-config-airbnb-extended` package also offers a **strict mode**, which includes a set of stricter ESLint rules for **imports**, **React**, and **TypeScript**. These rules aren’t enabled by default, but if you want to improve the consistency and quality of your code even more, you can turn them on easily.
|
|
52
|
+
|
|
53
|
+
To enable it, you'll need to import the strict rules from the config like this:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { rules } from 'eslint-config-airbnb-extended';️
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then, in your ESLint configuration (`eslint.config.mjs`), add these rules:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
rules: {
|
|
63
|
+
...rules.base.importsStrict,
|
|
64
|
+
...rules.react.strict,
|
|
65
|
+
...rules.typescript.typescriptEslintStrict,
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### What do these strict rules include?
|
|
70
|
+
|
|
71
|
+
**1. Strict Imports**
|
|
72
|
+
|
|
73
|
+
- Enforces a consistent and clean import order
|
|
74
|
+
- Differentiates between type imports and value imports
|
|
75
|
+
- and many more...
|
|
76
|
+
|
|
77
|
+
**2. Strict React**
|
|
78
|
+
|
|
79
|
+
- Requires `key` props in lists
|
|
80
|
+
- Sorts JSX props
|
|
81
|
+
- Disables `prop-types` (since TypeScript is the focus)
|
|
82
|
+
- and many more...
|
|
83
|
+
|
|
84
|
+
**3. Strict TypeScript ESLint**
|
|
85
|
+
|
|
86
|
+
- Disallows `@ts-ignore`, prefers `@ts-expect-error`
|
|
87
|
+
- Bans `any`
|
|
88
|
+
- Disallows non-null assertions (`!`)
|
|
89
|
+
- Encourages using Nullish coalescing operator (`??`) and optional chaining (`?.`)
|
|
90
|
+
- and many more...
|
|
91
|
+
|
|
49
92
|
## FAQs
|
|
50
93
|
|
|
51
94
|
### How to Configure for a Monorepo?
|
|
@@ -4,18 +4,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const config_1 = __importDefault(require("../../configs/base/config"));
|
|
7
|
+
const getImportSettings_1 = __importDefault(require("../../helpers/getImportSettings"));
|
|
7
8
|
const getStylisticLegacyConfig_1 = __importDefault(require("../../helpers/getStylisticLegacyConfig"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
8
10
|
const baseRecommendedConfig = [
|
|
9
11
|
...Object.values(config_1.default),
|
|
10
12
|
{
|
|
11
|
-
name: 'airbnb/config/base-
|
|
13
|
+
name: 'airbnb/config/base-configurations',
|
|
14
|
+
files: utils_1.allFiles,
|
|
12
15
|
languageOptions: {
|
|
13
16
|
parserOptions: {
|
|
14
17
|
ecmaVersion: 2018,
|
|
15
18
|
sourceType: 'module',
|
|
16
19
|
},
|
|
17
20
|
},
|
|
21
|
+
settings: {
|
|
22
|
+
'import-x/core-modules': [],
|
|
23
|
+
'import-x/ignore': ['node_modules', String.raw `\.(coffee|scss|css|less|hbs|svg|json)$`],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'airbnb/config/base-settings-extensions-configurations',
|
|
28
|
+
files: utils_1.jsFileWithoutReact,
|
|
29
|
+
settings: (0, getImportSettings_1.default)({ javascript: true, typescript: false, jsx: false }),
|
|
18
30
|
},
|
|
19
|
-
Object.assign({ name: 'airbnb/config/base-disable-legacy-stylistic-js-config' }, (0, getStylisticLegacyConfig_1.default)('javascript')),
|
|
31
|
+
Object.assign({ name: 'airbnb/config/base-disable-legacy-stylistic-js-config', files: utils_1.allFiles }, (0, getStylisticLegacyConfig_1.default)('javascript')),
|
|
20
32
|
];
|
|
21
33
|
exports.default = baseRecommendedConfig;
|
|
@@ -3,24 +3,19 @@ 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_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
|
|
7
6
|
const typescript_eslint_1 = require("typescript-eslint");
|
|
8
7
|
const config_1 = __importDefault(require("../../configs/typescript/config"));
|
|
8
|
+
const getImportSettings_1 = __importDefault(require("../../helpers/getImportSettings"));
|
|
9
9
|
const getStylisticLegacyConfig_1 = __importDefault(require("../../helpers/getStylisticLegacyConfig"));
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
10
11
|
const baseTypescriptConfig = [
|
|
11
12
|
...Object.values(config_1.default),
|
|
12
13
|
{
|
|
13
|
-
name: 'airbnb/config/base-typescript-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'import-x/resolver-next': [
|
|
17
|
-
(0, eslint_import_resolver_typescript_1.createTypeScriptImportResolver)({
|
|
18
|
-
alwaysTryTypes: true,
|
|
19
|
-
}),
|
|
20
|
-
],
|
|
21
|
-
},
|
|
14
|
+
name: 'airbnb/config/base-typescript-settings-extensions-configurations',
|
|
15
|
+
files: utils_1.tsFileWithoutReact,
|
|
16
|
+
settings: (0, getImportSettings_1.default)({ javascript: false, typescript: true, jsx: false }),
|
|
22
17
|
},
|
|
23
|
-
Object.assign({ name: 'airbnb/config/base-typescript-disable-legacy-stylistic-ts-config' }, (0, getStylisticLegacyConfig_1.default)('typescript')),
|
|
24
|
-
Object.assign(Object.assign({}, typescript_eslint_1.configs.disableTypeChecked), { name: 'airbnb/config/base-typescript-disable-type-checked', files:
|
|
18
|
+
Object.assign({ name: 'airbnb/config/base-typescript-disable-legacy-stylistic-ts-config', files: utils_1.tsFiles }, (0, getStylisticLegacyConfig_1.default)('typescript')),
|
|
19
|
+
Object.assign(Object.assign({}, typescript_eslint_1.configs.disableTypeChecked), { name: 'airbnb/config/base-typescript-disable-type-checked', files: utils_1.jsFiles }),
|
|
25
20
|
];
|
|
26
21
|
exports.default = baseTypescriptConfig;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const config_1 = __importDefault(require("../../configs/next/config"));
|
|
7
7
|
const recommended_1 = __importDefault(require("../../configs/react/recommended"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
8
9
|
const nextRecommendedConfig = [
|
|
9
10
|
...recommended_1.default,
|
|
10
11
|
...Object.values(config_1.default),
|
|
@@ -17,6 +18,7 @@ const nextRecommendedConfig = [
|
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
name: 'airbnb/config/next-react-jsx-runtime',
|
|
21
|
+
files: utils_1.allFiles,
|
|
20
22
|
rules: {
|
|
21
23
|
'react/jsx-uses-react': 'off',
|
|
22
24
|
'react/react-in-jsx-scope': 'off',
|
|
@@ -7,10 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
|
|
8
8
|
const config_1 = __importDefault(require("../../configs/node/config"));
|
|
9
9
|
const nodeNoUnsupportedFeatures_1 = __importDefault(require("../../rules/node/nodeNoUnsupportedFeatures"));
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
10
11
|
const flatNodeConfig = eslint_plugin_n_1.default.configs['flat/recommended'];
|
|
11
12
|
const nodeRecommendedConfig = [
|
|
12
13
|
...Object.values(config_1.default),
|
|
13
|
-
Object.assign({ name: 'airbnb/config/node-configurations' }, (flatNodeConfig
|
|
14
|
+
Object.assign({ name: 'airbnb/config/node-configurations', files: utils_1.allFiles }, (flatNodeConfig
|
|
14
15
|
? {
|
|
15
16
|
languageOptions: flatNodeConfig.languageOptions,
|
|
16
17
|
rules: {
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const config_1 = __importDefault(require("../../configs/react/config"));
|
|
7
|
+
const getImportSettings_1 = __importDefault(require("../../helpers/getImportSettings"));
|
|
7
8
|
const getStylisticLegacyConfig_1 = __importDefault(require("../../helpers/getStylisticLegacyConfig"));
|
|
8
9
|
const style_1 = __importDefault(require("../../rules/style"));
|
|
9
10
|
const utils_1 = require("../../utils");
|
|
@@ -11,17 +12,13 @@ const dangleRules = style_1.default.rules['no-underscore-dangle'];
|
|
|
11
12
|
const reactRecommendedConfig = [
|
|
12
13
|
...Object.values(config_1.default),
|
|
13
14
|
{
|
|
14
|
-
name: 'airbnb/config/react-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
node: {
|
|
18
|
-
extensions: utils_1.jsExtensionsWithReact,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
15
|
+
name: 'airbnb/config/react-settings-extensions-configurations',
|
|
16
|
+
files: utils_1.jsFiles,
|
|
17
|
+
settings: (0, getImportSettings_1.default)({ javascript: true, typescript: false, jsx: true }),
|
|
22
18
|
},
|
|
23
19
|
{
|
|
24
20
|
name: 'airbnb/config/react-configurations',
|
|
21
|
+
files: utils_1.allFiles,
|
|
25
22
|
rules: {
|
|
26
23
|
// disallow dangling underscores in identifiers
|
|
27
24
|
// https://eslint.org/docs/latest/rules/no-underscore-dangle
|
|
@@ -60,12 +57,13 @@ const reactRecommendedConfig = [
|
|
|
60
57
|
},
|
|
61
58
|
{
|
|
62
59
|
name: 'airbnb/config/react-stylistic',
|
|
60
|
+
files: utils_1.allFiles,
|
|
63
61
|
rules: {
|
|
64
62
|
// specify whether double or single quotes should be used in JSX attributes
|
|
65
63
|
// https://eslint.style/rules/js/jsx-quotes
|
|
66
64
|
'@stylistic/jsx-quotes': ['error', 'prefer-double'],
|
|
67
65
|
},
|
|
68
66
|
},
|
|
69
|
-
Object.assign({ name: 'airbnb/config/react-disable-legacy-stylistic-react-config' }, (0, getStylisticLegacyConfig_1.default)('react')),
|
|
67
|
+
Object.assign({ name: 'airbnb/config/react-disable-legacy-stylistic-react-config', files: utils_1.allFiles }, (0, getStylisticLegacyConfig_1.default)('react')),
|
|
70
68
|
];
|
|
71
69
|
exports.default = reactRecommendedConfig;
|
|
@@ -1,9 +1,14 @@
|
|
|
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 });
|
|
6
|
+
const getImportSettings_1 = __importDefault(require("../../helpers/getImportSettings"));
|
|
3
7
|
const utils_1 = require("../../utils");
|
|
4
8
|
const reactTypescriptConfig = [
|
|
5
9
|
{
|
|
6
10
|
name: 'airbnb/config/react-typescript-react',
|
|
11
|
+
files: utils_1.tsFiles,
|
|
7
12
|
rules: {
|
|
8
13
|
// only .jsx and .tsx files may have JSX
|
|
9
14
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
@@ -16,14 +21,9 @@ const reactTypescriptConfig = [
|
|
|
16
21
|
},
|
|
17
22
|
},
|
|
18
23
|
{
|
|
19
|
-
name: 'airbnb/config/react-typescript-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
node: {
|
|
23
|
-
extensions: [...utils_1.jsExtensionsResolver, ...utils_1.tsExtensionsWithReactDTS],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
24
|
+
name: 'airbnb/config/react-typescript-settings-extensions-configurations',
|
|
25
|
+
files: utils_1.tsFiles,
|
|
26
|
+
settings: (0, getImportSettings_1.default)({ javascript: false, typescript: true, jsx: true }),
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
29
|
exports.default = reactTypescriptConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const eslint_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
|
|
4
|
+
const eslint_plugin_import_x_1 = require("eslint-plugin-import-x");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const getImportSettings = (params) => {
|
|
7
|
+
const { javascript, typescript, jsx } = params;
|
|
8
|
+
const extensions = (() => {
|
|
9
|
+
if (jsx) {
|
|
10
|
+
if (javascript)
|
|
11
|
+
return utils_1.jsExtensionsWithReact;
|
|
12
|
+
if (typescript)
|
|
13
|
+
return utils_1.tsExtensionsWithReactDTS;
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
if (javascript)
|
|
17
|
+
return utils_1.jsExtensions;
|
|
18
|
+
if (typescript)
|
|
19
|
+
return utils_1.tsExtensionsResolver;
|
|
20
|
+
return [];
|
|
21
|
+
})();
|
|
22
|
+
return Object.assign({ 'import-x/resolver-next': [
|
|
23
|
+
(0, eslint_plugin_import_x_1.createNodeResolver)({ extensions: [...extensions, '.json'] }),
|
|
24
|
+
...(typescript
|
|
25
|
+
? [
|
|
26
|
+
(0, eslint_import_resolver_typescript_1.createTypeScriptImportResolver)({
|
|
27
|
+
alwaysTryTypes: true,
|
|
28
|
+
}),
|
|
29
|
+
]
|
|
30
|
+
: []),
|
|
31
|
+
], 'import-x/extensions': extensions }, (typescript
|
|
32
|
+
? {
|
|
33
|
+
// Apply special parsing for TypeScript files
|
|
34
|
+
'import-x/parsers': {
|
|
35
|
+
'@typescript-eslint/parser': extensions,
|
|
36
|
+
},
|
|
37
|
+
// Resolve type definition packages
|
|
38
|
+
'import-x/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
39
|
+
}
|
|
40
|
+
: null));
|
|
41
|
+
};
|
|
42
|
+
exports.default = getImportSettings;
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_import_x_1 = __importDefault(require("eslint-plugin-import-x"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const importXPluginConfig = {
|
|
8
9
|
name: 'airbnb/config/plugin/import-x',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
'import-x': eslint_plugin_import_x_1.default,
|
|
11
13
|
},
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
// eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
|
|
4
5
|
const plugin = require('@next/eslint-plugin-next');
|
|
5
6
|
const nextPlugin = {
|
|
6
7
|
name: 'airbnb/config/plugin/next',
|
|
8
|
+
files: utils_1.allFiles,
|
|
7
9
|
plugins: {
|
|
8
10
|
'@next/next': plugin,
|
|
9
11
|
},
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const nodePlugin = {
|
|
8
9
|
name: 'airbnb/config/plugin/node',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
n: eslint_plugin_n_1.default,
|
|
11
13
|
},
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_jsx_a11y_1 = __importDefault(require("eslint-plugin-jsx-a11y"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const reactA11yPlugin = {
|
|
8
9
|
name: 'airbnb/config/plugin/react-a11y',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
'jsx-a11y': eslint_plugin_jsx_a11y_1.default,
|
|
11
13
|
},
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const reactHooksPlugin = {
|
|
8
9
|
name: 'airbnb/config/plugin/react-hooks',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
'react-hooks': eslint_plugin_react_hooks_1.default,
|
|
11
13
|
},
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const reactPlugin = {
|
|
8
9
|
name: 'airbnb/config/plugin/react',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
react: eslint_plugin_react_1.default,
|
|
11
13
|
},
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const eslint_plugin_1 = __importDefault(require("@stylistic/eslint-plugin"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const stylisticPlugin = {
|
|
8
9
|
name: 'airbnb/config/plugin/stylistic',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
plugins: {
|
|
10
12
|
'@stylistic': eslint_plugin_1.default,
|
|
11
13
|
},
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const typescript_eslint_1 = require("typescript-eslint");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
4
5
|
const typescriptEslintPlugin = {
|
|
5
6
|
name: 'airbnb/config/plugin/typescript-eslint',
|
|
7
|
+
files: utils_1.tsFiles,
|
|
6
8
|
plugins: {
|
|
7
9
|
'@typescript-eslint': typescript_eslint_1.plugin,
|
|
8
10
|
},
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const bestPracticesRules = {
|
|
4
5
|
name: 'airbnb/config/best-practices',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// enforces getter/setter pairs in objects
|
|
7
9
|
// https://eslint.org/docs/rules/accessor-pairs
|
package/dist/rules/errors.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const errorsRules = {
|
|
4
5
|
name: 'airbnb/config/errors',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Enforce “for” loop update clause moving the counter in the right direction
|
|
7
9
|
// https://eslint.org/docs/rules/for-direction
|
package/dist/rules/es6.js
CHANGED
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const globals_1 = __importDefault(require("globals"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const es6Rules = {
|
|
8
9
|
name: 'airbnb/config/es6',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
languageOptions: {
|
|
10
12
|
globals: Object.assign({}, globals_1.default.es2015),
|
|
11
13
|
parserOptions: {
|
package/dist/rules/imports.js
CHANGED
|
@@ -9,6 +9,7 @@ const getDevDepsList_1 = __importDefault(require("../helpers/getDevDepsList"));
|
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
const importsRules = {
|
|
11
11
|
name: 'airbnb/config/import-x',
|
|
12
|
+
files: utils_1.allFiles,
|
|
12
13
|
languageOptions: {
|
|
13
14
|
globals: Object.assign({}, globals_1.default.es2015),
|
|
14
15
|
parserOptions: {
|
|
@@ -16,16 +17,6 @@ const importsRules = {
|
|
|
16
17
|
sourceType: 'module',
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
|
-
settings: {
|
|
20
|
-
'import-x/resolver': {
|
|
21
|
-
node: {
|
|
22
|
-
extensions: utils_1.jsExtensionsResolver,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
'import-x/extensions': utils_1.jsExtensionsWithReact,
|
|
26
|
-
'import-x/core-modules': [],
|
|
27
|
-
'import-x/ignore': ['node_modules', String.raw `\.(coffee|scss|css|less|hbs|svg|json)$`],
|
|
28
|
-
},
|
|
29
20
|
rules: {
|
|
30
21
|
// enforce a consistent style for type specifiers (inline or top-level)
|
|
31
22
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
|
|
@@ -198,6 +189,7 @@ const importsRules = {
|
|
|
198
189
|
};
|
|
199
190
|
exports.deprecatedImportsRules = {
|
|
200
191
|
name: 'airbnb/config/import-x/deprecated',
|
|
192
|
+
files: utils_1.allFiles,
|
|
201
193
|
rules: {
|
|
202
194
|
// disallow non-import statements appearing before import statements
|
|
203
195
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const importsStrictRules = {
|
|
4
5
|
name: 'airbnb/config/import-x/strict',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// enforce a consistent style for type specifiers (inline or top-level)
|
|
7
9
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const nextBaseRules = {
|
|
4
5
|
name: 'airbnb/config/next/base',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Enforce font-display behavior with Google Fonts.
|
|
7
9
|
// https://nextjs.org/docs/messages/google-font-display
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const nextCoreWebVitalsRules = {
|
|
4
5
|
name: 'airbnb/config/next/core-web-vitals',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Prevent usage of `<a>` elements to navigate to internal Next.js pages.
|
|
7
9
|
'@next/next/no-html-link-for-pages': 'error',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deprecatedNodeBaseRules = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
4
5
|
const nodeBaseRules = {
|
|
5
6
|
name: 'airbnb/config/node/base',
|
|
7
|
+
files: utils_1.allFiles,
|
|
6
8
|
rules: {
|
|
7
9
|
// Require return statements after callbacks
|
|
8
10
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
|
|
@@ -107,6 +109,7 @@ const nodeBaseRules = {
|
|
|
107
109
|
};
|
|
108
110
|
exports.deprecatedNodeBaseRules = {
|
|
109
111
|
name: 'airbnb/config/node/base/deprecated',
|
|
112
|
+
files: utils_1.allFiles,
|
|
110
113
|
rules: {
|
|
111
114
|
// Disallow third-party modules which are hiding core modules
|
|
112
115
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-hide-core-modules.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const nodeGlobalsRules = {
|
|
4
5
|
name: 'airbnb/config/node/globals',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Enforce either Buffer or require("buffer").Buffer
|
|
7
9
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const nodeNoUnsupportedFeaturesRules = {
|
|
4
5
|
name: 'airbnb/config/node/unsupported-features',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Disallow unsupported ECMAScript built-ins on the specified version
|
|
7
9
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-builtins.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const nodePromisesRules = {
|
|
4
5
|
name: 'airbnb/config/node/promises',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// Enforce require("dns").promises
|
|
7
9
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/dns.md
|
|
@@ -5,8 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.deprecatedReactBaseRules = void 0;
|
|
7
7
|
const globals_1 = __importDefault(require("globals"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
8
9
|
const reactBaseRules = {
|
|
9
10
|
name: 'airbnb/config/react',
|
|
11
|
+
files: utils_1.allFiles,
|
|
10
12
|
languageOptions: {
|
|
11
13
|
parserOptions: {
|
|
12
14
|
ecmaFeatures: {
|
|
@@ -570,6 +572,7 @@ const reactBaseRules = {
|
|
|
570
572
|
};
|
|
571
573
|
exports.deprecatedReactBaseRules = {
|
|
572
574
|
name: 'airbnb/config/react/deprecated',
|
|
575
|
+
files: utils_1.allFiles,
|
|
573
576
|
rules: {
|
|
574
577
|
// Enforce defaultProps declarations alphabetical sorting
|
|
575
578
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-default-props.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const reactHooksRules = {
|
|
4
5
|
name: 'airbnb/config/react-hooks',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
languageOptions: {
|
|
6
8
|
parserOptions: {
|
|
7
9
|
ecmaFeatures: {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deprecatedReactJsxA11yRules = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
4
5
|
const reactJsxA11yRules = {
|
|
5
6
|
name: 'airbnb/config/react-jsx-a11y',
|
|
7
|
+
files: utils_1.allFiles,
|
|
6
8
|
languageOptions: {
|
|
7
9
|
parserOptions: {
|
|
8
10
|
ecmaFeatures: {
|
|
@@ -244,6 +246,7 @@ const reactJsxA11yRules = {
|
|
|
244
246
|
};
|
|
245
247
|
exports.deprecatedReactJsxA11yRules = {
|
|
246
248
|
name: 'airbnb/config/react-jsx-a11y/deprecated',
|
|
249
|
+
files: utils_1.allFiles,
|
|
247
250
|
rules: {
|
|
248
251
|
// ensure emoji are accessible
|
|
249
252
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const reactStrictRules = {
|
|
4
5
|
name: 'airbnb/config/react/strict',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// This rule enforces onChange or readonly attribute for checked property of input elements.
|
|
7
9
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deprecatedReactStylisticPlusRules = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
4
5
|
const reactStylisticRules = {
|
|
5
6
|
name: 'airbnb/config/react/stylistic',
|
|
7
|
+
files: utils_1.allFiles,
|
|
6
8
|
rules: {
|
|
7
9
|
// Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
|
|
8
10
|
// https://eslint.style/rules/jsx/jsx-child-element-spacing
|
|
@@ -83,6 +85,7 @@ const reactStylisticRules = {
|
|
|
83
85
|
};
|
|
84
86
|
exports.deprecatedReactStylisticPlusRules = {
|
|
85
87
|
name: 'airbnb/config/react/stylistic/deprecated',
|
|
88
|
+
files: utils_1.allFiles,
|
|
86
89
|
rules: {
|
|
87
90
|
// Enforce JSX indentation.
|
|
88
91
|
// https://eslint.style/rules/jsx/jsx-indent
|
package/dist/rules/strict.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const strictRules = {
|
|
4
5
|
name: 'airbnb/config/strict',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// babel inserts `'use strict';` for us
|
|
7
9
|
strict: ['error', 'never'],
|
package/dist/rules/style.js
CHANGED
package/dist/rules/stylistic.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deprecatedStylisticRules = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
4
5
|
const stylisticRules = {
|
|
5
6
|
name: 'airbnb/config/stylistic',
|
|
7
|
+
files: utils_1.allFiles,
|
|
6
8
|
rules: {
|
|
7
9
|
// enforce line breaks after opening and before closing array brackets
|
|
8
10
|
// https://eslint.style/rules/js/array-bracket-newline
|
|
@@ -512,6 +514,7 @@ const stylisticRules = {
|
|
|
512
514
|
};
|
|
513
515
|
exports.deprecatedStylisticRules = {
|
|
514
516
|
name: 'airbnb/config/stylistic/deprecated',
|
|
517
|
+
files: utils_1.allFiles,
|
|
515
518
|
rules: {
|
|
516
519
|
// enforce spacing between functions and their invocations
|
|
517
520
|
// https://eslint.style/rules/js/function-call-spacing
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const stylisticPlusRules = {
|
|
4
5
|
name: 'airbnb/config/stylistic-plus',
|
|
6
|
+
files: utils_1.allFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// A number of style guides require or disallow line breaks inside of block statements and block-like code.
|
|
7
9
|
// https://eslint.style/rules/plus/curly-newline
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const typescriptBaseRules = {
|
|
4
5
|
name: 'airbnb/config/typescript/base',
|
|
6
|
+
files: utils_1.tsFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler
|
|
7
9
|
// Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts
|
|
@@ -8,8 +8,10 @@ const best_practices_1 = __importDefault(require("../../rules/best-practices"));
|
|
|
8
8
|
const es6_1 = __importDefault(require("../../rules/es6"));
|
|
9
9
|
const style_1 = __importDefault(require("../../rules/style"));
|
|
10
10
|
const variables_1 = __importDefault(require("../../rules/variables"));
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
11
12
|
const typescriptEslintRules = {
|
|
12
13
|
name: 'airbnb/config/typescript/typescript-eslint',
|
|
14
|
+
files: utils_1.tsFiles,
|
|
13
15
|
languageOptions: {
|
|
14
16
|
parserOptions: {
|
|
15
17
|
projectService: true,
|
|
@@ -477,6 +479,7 @@ const typescriptEslintRules = {
|
|
|
477
479
|
};
|
|
478
480
|
exports.deprecatedTypescriptEslintRules = {
|
|
479
481
|
name: 'airbnb/config/typescript/typescript-eslint/deprecated',
|
|
482
|
+
files: utils_1.tsFiles,
|
|
480
483
|
rules: {
|
|
481
484
|
// Disallow the declaration of empty interfaces.
|
|
482
485
|
// https://typescript-eslint.io/rules/no-empty-interface
|
|
@@ -10,22 +10,7 @@ const utils_1 = require("../../utils");
|
|
|
10
10
|
*/
|
|
11
11
|
const typescriptImportsRules = {
|
|
12
12
|
name: 'airbnb/config/typescript/import-x',
|
|
13
|
-
|
|
14
|
-
// Apply special parsing for TypeScript files
|
|
15
|
-
'import-x/parsers': {
|
|
16
|
-
'@typescript-eslint/parser': utils_1.tsExtensionsResolver,
|
|
17
|
-
},
|
|
18
|
-
// Append 'ts' extensions to Airbnb 'import-x/resolver' setting
|
|
19
|
-
'import-x/resolver': {
|
|
20
|
-
node: {
|
|
21
|
-
extensions: [...utils_1.jsExtensionsResolver, ...utils_1.tsExtensionsResolver],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
// Append 'ts' extensions to Airbnb 'import-x/extensions' setting
|
|
25
|
-
'import-x/extensions': [...utils_1.jsExtensionsWithReact, ...utils_1.tsExtensionsWithReactDTS],
|
|
26
|
-
// Resolve type definition packages
|
|
27
|
-
'import-x/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
28
|
-
},
|
|
13
|
+
files: utils_1.tsFiles,
|
|
29
14
|
rules: {
|
|
30
15
|
// Append 'ts' and 'tsx' to Airbnb 'import-x/extensions' rule
|
|
31
16
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md
|
|
@@ -35,8 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.deprecatedTypescriptStylisticRules = void 0;
|
|
37
37
|
const stylistic_1 = __importStar(require("../../rules/stylistic"));
|
|
38
|
+
const utils_1 = require("../../utils");
|
|
38
39
|
const typescriptStylisticRules = {
|
|
39
40
|
name: 'airbnb/config/typescript/typescript-stylistic',
|
|
41
|
+
files: utils_1.tsFiles,
|
|
40
42
|
rules: {
|
|
41
43
|
// enforce spacing inside single-line blocks
|
|
42
44
|
// https://eslint.style/rules/ts/block-spacing
|
|
@@ -138,6 +140,7 @@ const typescriptStylisticRules = {
|
|
|
138
140
|
};
|
|
139
141
|
exports.deprecatedTypescriptStylisticRules = {
|
|
140
142
|
name: 'airbnb/config/typescript/typescript-stylistic/deprecated',
|
|
143
|
+
files: utils_1.tsFiles,
|
|
141
144
|
rules: {
|
|
142
145
|
// enforce spacing between functions and their invocations
|
|
143
146
|
// https://eslint.style/rules/ts/function-call-spacing
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
3
4
|
const typescriptStylisticPlusRules = {
|
|
4
5
|
name: 'airbnb/config/typescript/typescript-stylistic-plus',
|
|
6
|
+
files: utils_1.tsFiles,
|
|
5
7
|
rules: {
|
|
6
8
|
// enforce consistent spacing inside TypeScript type generics
|
|
7
9
|
// https://eslint.style/rules/plus/type-generic-spacing
|
package/dist/rules/variables.js
CHANGED
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const confusing_browser_globals_1 = __importDefault(require("confusing-browser-globals"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
const variablesRules = {
|
|
8
9
|
name: 'airbnb/config/variables',
|
|
10
|
+
files: utils_1.allFiles,
|
|
9
11
|
rules: {
|
|
10
12
|
// enforce or disallow variable initializations at definition
|
|
11
13
|
'init-declarations': 'off',
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tsFiles = exports.tsExtensionsRule = exports.tsExtensionsResolver = exports.tsExtensionsWithReactDTS = exports.tsExtensionsWithReact = exports.tsExtensions = exports.jsExtensionsRule = exports.jsExtensionsResolver = exports.jsExtensionsWithReact = exports.jsExtensions = void 0;
|
|
3
|
+
exports.allFiles = exports.tsFileWithoutReact = exports.tsFiles = exports.jsFileWithoutReact = exports.jsFiles = exports.tsExtensionsRule = exports.tsExtensionsResolver = exports.tsExtensionsWithReactDTS = exports.tsExtensionsWithReact = exports.tsExtensions = exports.jsExtensionsRule = exports.jsExtensionsResolver = exports.jsExtensionsWithReact = exports.jsExtensions = void 0;
|
|
4
4
|
exports.jsExtensions = ['.js', '.cjs', '.mjs'];
|
|
5
5
|
exports.jsExtensionsWithReact = [...exports.jsExtensions, '.jsx'];
|
|
6
6
|
exports.jsExtensionsResolver = [...exports.jsExtensions, '.json'];
|
|
@@ -11,4 +11,8 @@ exports.tsExtensionsWithReactDTS = [...exports.tsExtensionsWithReact, '.d.ts'];
|
|
|
11
11
|
exports.tsExtensionsResolver = [...exports.tsExtensions, '.d.ts'];
|
|
12
12
|
exports.tsExtensionsRule = Object.fromEntries(Object.values(exports.tsExtensionsWithReact).map((val) => [val.slice(1), 'never']));
|
|
13
13
|
// ESLINT CONFIG FILES
|
|
14
|
-
exports.
|
|
14
|
+
exports.jsFiles = exports.jsExtensionsWithReact.map((val) => `**/*${val}`);
|
|
15
|
+
exports.jsFileWithoutReact = exports.jsExtensions.map((val) => `**/*${val}`);
|
|
16
|
+
exports.tsFiles = exports.tsExtensionsWithReactDTS.map((val) => `**/*${val}`);
|
|
17
|
+
exports.tsFileWithoutReact = exports.tsExtensionsResolver.map((val) => `**/*${val}`);
|
|
18
|
+
exports.allFiles = [...exports.jsFiles, ...exports.tsFiles];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-airbnb-extended",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Eslint Airbnb Config Extended",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tsc-alias": "^1.8.15",
|
|
43
43
|
"tsconfig-paths": "^4.2.0",
|
|
44
44
|
"typescript": "^5.8.3",
|
|
45
|
-
"typescript-eslint": "^8.
|
|
45
|
+
"typescript-eslint": "^8.31.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@next/eslint-plugin-next": "15.x",
|