eslint-config-airbnb-extended 2.0.0-beta-3 → 2.0.0-beta-5
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 +69 -0
- package/dist/rules/node/nodeBase.js +3 -0
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ To learn more about the configuration options available for `create-airbnb-x-con
|
|
|
20
20
|
|
|
21
21
|
### Steps
|
|
22
22
|
|
|
23
|
+
First, you need to decide whether you want to use the `legacy` config or the `extended` config. If you're not sure about the difference between the two, you can refer to the [Extended vs Legacy Config](https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#difference-between-extended-vs-legacy-config) for a brief explanation. For more information specifically about the Legacy config, check out the [Legacy Config](https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#legacy-config). If you decide to use the Extended config, you can proceed with the steps below. Otherwise, feel free to switch to the Legacy config if that better fits your requirements.
|
|
24
|
+
|
|
23
25
|
You can choose whether to **install** or **not install** based on your needs.
|
|
24
26
|
|
|
25
27
|
- If you choose **installation**, the package will automatically detect your project's package manager and install all the required dependencies.
|
|
@@ -33,6 +35,67 @@ While **manual installation** is possible, we strongly recommend using `create-a
|
|
|
33
35
|
|
|
34
36
|
The configuration may change over time, and `create-airbnb-x-config` will always stay up-to-date with the latest versions. If you're confident in handling manual installations, refer to the [Packages Used](https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#packages-used) section for more information on the individual packages.
|
|
35
37
|
|
|
38
|
+
## Legacy Config
|
|
39
|
+
|
|
40
|
+
Many people are currently using Airbnb's ESLint configs, like `eslint-config-airbnb`, and they want a way to switch or upgrade without making any changes to their existing config setup.
|
|
41
|
+
|
|
42
|
+
Right now, the new process for setting up configs is more complex, and not everyone wants to go through it. What developers really need is a simple and direct replacement for the existing Airbnb configs, a solution that keeps everything working the same way as before, with no rule or behavior changes. It should also make sure all packages used are updated to the latest versions.
|
|
43
|
+
|
|
44
|
+
In short, the goal is:
|
|
45
|
+
|
|
46
|
+
- No need to learn or adopt new config styles
|
|
47
|
+
- No changes in rule behavior or structure
|
|
48
|
+
- Easy to migrate by just changing the import path
|
|
49
|
+
- All packages should be latest
|
|
50
|
+
|
|
51
|
+
Here’s the way to use the **Airbnb legacy configurations** with the flat config format under `eslint-config-airbnb-extended/legacy`.
|
|
52
|
+
|
|
53
|
+
#### For `eslint-config-airbnb-base`
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { configs } from 'eslint-config-airbnb-extended/legacy';
|
|
57
|
+
|
|
58
|
+
// Equivalent to airbnb-base/legacy
|
|
59
|
+
export default [...configs.base.legacy];
|
|
60
|
+
|
|
61
|
+
// Equivalent to airbnb-base
|
|
62
|
+
export default [...configs.base.recommended];
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
#### For `eslint-config-airbnb`
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { configs } from 'eslint-config-airbnb-extended/legacy';
|
|
71
|
+
|
|
72
|
+
// Equivalent to airbnb/legacy
|
|
73
|
+
export default [...configs.react.legacy];
|
|
74
|
+
|
|
75
|
+
// Equivalent to airbnb/base
|
|
76
|
+
export default [...configs.react.base];
|
|
77
|
+
|
|
78
|
+
// Equivalent to airbnb
|
|
79
|
+
export default [...configs.react.recommended];
|
|
80
|
+
|
|
81
|
+
// Equivalent to airbnb/hooks
|
|
82
|
+
export default [...configs.react.hooks];
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### For `eslint-config-airbnb-typescript`
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { configs } from 'eslint-config-airbnb-extended/legacy';
|
|
91
|
+
|
|
92
|
+
// Equivalent to airbnb-typescript/base
|
|
93
|
+
export default [...configs.base.typescript];
|
|
94
|
+
|
|
95
|
+
// Equivalent to airbnb-typescript
|
|
96
|
+
export default [...configs.react.typescript];
|
|
97
|
+
```
|
|
98
|
+
|
|
36
99
|
## Packages Used
|
|
37
100
|
|
|
38
101
|
This configuration relies on the following essential packages:
|
|
@@ -92,6 +155,12 @@ export default [
|
|
|
92
155
|
|
|
93
156
|
## FAQs
|
|
94
157
|
|
|
158
|
+
### Difference between Extended vs Legacy Config
|
|
159
|
+
|
|
160
|
+
**Legacy Config** – Designed to be a one-to-one replacement of the original Airbnb ESLint configurations using the new flat config format. Its main purpose is to maintain backward compatibility by continuing to use the same packages as the original setup. For more details, see the [Legacy Config](https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#legacy-config).
|
|
161
|
+
|
|
162
|
+
**Extended Config** – A modern ESLint configuration based on `eslint-config-airbnb`, built from scratch with updated rules, replacement of deprecated ones using community recommended alternatives, and the adoption of the latest best-practice packages. For more details on the packages used, refer to the [Packages Used](https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#packages-used) section.
|
|
163
|
+
|
|
95
164
|
### How to Configure for a Monorepo?
|
|
96
165
|
|
|
97
166
|
If you're working in a monorepo setup, it's recommended to run the installation command in the specific sub-folder where you want the configuration. Alternatively, you can choose to skip the package installation, and we'll provide a customized set of commands based on your selection, allowing you to install it according to your preferred method.
|
|
@@ -88,6 +88,9 @@ const nodeBaseRules = {
|
|
|
88
88
|
ignores: [],
|
|
89
89
|
},
|
|
90
90
|
],
|
|
91
|
+
// Disallow top-level await in published modules
|
|
92
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-top-level-await.md
|
|
93
|
+
'n/no-top-level-await': 'off',
|
|
91
94
|
// Disallow bin files that npm ignores
|
|
92
95
|
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-bin.md
|
|
93
96
|
'n/no-unpublished-bin': 'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-airbnb-extended",
|
|
3
|
-
"version": "2.0.0-beta-
|
|
3
|
+
"version": "2.0.0-beta-5",
|
|
4
4
|
"description": "Eslint Airbnb Config Extended",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -43,14 +43,11 @@
|
|
|
43
43
|
"globals": "^16.2.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@stylistic/eslint-plugin": "^3.1.0",
|
|
47
46
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
48
|
-
"@types/node": "^22.15.29",
|
|
49
47
|
"rimraf": "^6.0.1",
|
|
50
48
|
"tsc-alias": "^1.8.16",
|
|
51
|
-
"tsx": "^4.
|
|
52
|
-
"typescript": "^5.8.3"
|
|
53
|
-
"typescript-eslint": "^8.33.0"
|
|
49
|
+
"tsx": "^4.20.3",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
54
51
|
},
|
|
55
52
|
"peerDependencies": {
|
|
56
53
|
"@next/eslint-plugin-next": "15.x",
|