eslint-stylistic-airbnb 1.0.2 → 2.0.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.
package/README.md CHANGED
@@ -13,12 +13,13 @@ npm install -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb
13
13
  Add following to your eslint config:
14
14
 
15
15
  ```javascript
16
- // Flat config eslint.config.mjs
16
+ // Flat config
17
+ // eslint.config.mjs
17
18
  import stylistic from '@stylistic/eslint-plugin';
18
19
  import airbnb from 'eslint-stylistic-airbnb';
19
20
 
20
21
  export default [
21
- ...airbnb,
22
+ airbnb,
22
23
  {
23
24
  files: ['**/*.{js,mjs,cjs,ts}'],
24
25
  plugins: {
@@ -28,6 +29,22 @@ export default [
28
29
  ];
29
30
  ```
30
31
 
32
+ ```javascript
33
+ // Legacy config
34
+ // .eslintrc.js
35
+ module.exports = {
36
+ plugins: ['@stylistic'],
37
+ rules: {
38
+ ...require('eslint-stylistic-airbnb').rules,
39
+ },
40
+ parserOptions: {
41
+ ecmaVersion: 'latest',
42
+ },
43
+ };
44
+ ```
45
+
46
+ # TypeScript
47
+
31
48
  If you use typescript, install additional dependency:
32
49
 
33
50
  ```shell
@@ -37,13 +54,14 @@ npm install -D typescript-eslint
37
54
  And add following to your eslint config:
38
55
 
39
56
  ```javascript
40
- // Flat config eslint.config.mjs
57
+ // Flat config
58
+ // eslint.config.mjs
41
59
  import tseslint from 'typescript-eslint';
42
60
  import stylistic from '@stylistic/eslint-plugin';
43
61
  import airbnb from 'eslint-stylistic-airbnb';
44
62
 
45
63
  export default [
46
- ...airbnb,
64
+ airbnb,
47
65
  ...tseslint.configs.recommended,
48
66
  {
49
67
  files: ['**/*.{js,mjs,cjs,ts}'],
@@ -54,6 +72,21 @@ export default [
54
72
  ];
55
73
  ```
56
74
 
75
+ ```javascript
76
+ // Legacy config
77
+ // .eslintrc.js
78
+ module.exports = {
79
+ plugins: [
80
+ '@typescript-eslint',
81
+ '@stylistic',
82
+ ],
83
+ parser: '@typescript-eslint/parser',
84
+ rules: {
85
+ ...require('eslint-stylistic-airbnb').rules,
86
+ },
87
+ };
88
+ ```
89
+
57
90
  # Notes
58
91
 
59
92
  This config is created from the base airbnb config as is, with no changes to original rules
package/index.js CHANGED
@@ -5,11 +5,13 @@ const strict = require('./rules/strict.js');
5
5
  const style = require('./rules/style.js');
6
6
  const variables = require('./rules/variables.js');
7
7
 
8
- module.exports = [
9
- bestPractices,
10
- errors,
11
- es6,
12
- strict,
13
- style,
14
- variables,
15
- ];
8
+ module.exports = {
9
+ rules: {
10
+ ...bestPractices.rules,
11
+ ...errors.rules,
12
+ ...es6.rules,
13
+ ...strict.rules,
14
+ ...style.rules,
15
+ ...variables.rules,
16
+ },
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-stylistic-airbnb",
3
- "version": "1.0.2",
3
+ "version": "2.0.1",
4
4
  "description": "Airbnb config for eslint using stylistic plugin",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -21,11 +21,12 @@
21
21
  "rules"
22
22
  ],
23
23
  "license": "MIT",
24
+ "packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e",
24
25
  "dependencies": {
25
26
  "confusing-browser-globals": "^1.0.11"
26
27
  },
27
28
  "peerDependencies": {
28
- "eslint": ">=8.40.0",
29
+ "eslint": ">=8.57.0",
29
30
  "@stylistic/eslint-plugin": ">=2.0.0"
30
31
  }
31
- }
32
+ }
package/rules/style.js CHANGED
@@ -101,7 +101,7 @@ module.exports = {
101
101
  // enforce spacing between functions and their invocations
102
102
  // https://eslint.org/docs/rules/func-call-spacing
103
103
  // https://eslint.style/rules/default/func-call-spacing
104
- '@stylistic/func-call-spacing': ['error', 'never'],
104
+ '@stylistic/function-call-spacing': ['error', 'never'],
105
105
 
106
106
  // requires function names to match the name of the variable or property to which they are
107
107
  // assigned