eslint-stylistic-airbnb 2.0.1 → 3.0.0-rc.2

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
@@ -1,99 +1,472 @@
1
1
  # eslint-stylistic-airbnb
2
2
 
3
- Airbnb config for ESLint with style rules via @stylistic plugin
3
+ ![NPM Downloads](https://img.shields.io/npm/dm/eslint-stylistic-airbnb)
4
+ ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
4
5
 
5
- # Installation
6
+ A modern Airbnb ESLint config with the original formatting rules using [ESLint Stylistic](https://eslint.style/).
6
7
 
7
- Install all required dependencies
8
+ ## Table of Contents
8
9
 
9
- ```shell
10
- npm install -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb
10
+ - [Features](#features)
11
+ - [Why](#why)
12
+ - [Prerequisites](#prerequisites)
13
+ - [Installation](#installation)
14
+ - [Quickstart](#quickstart)
15
+ - [Configuration Reference](#configuration-reference)
16
+ - [Customizing Rules](#customizing-rules)
17
+ - [TypeScript Support](#typescript-support)
18
+ - [Migration Guide](#migration-guide)
19
+ - [Troubleshooting](#troubleshooting)
20
+ - [FAQ](#faq)
21
+ - [Contributing](#contributing)
22
+ - [License](#license)
23
+
24
+ ## Features
25
+
26
+ ✨ **Modern & Maintained** - Updated for ESLint 9+ with no deprecated rules or plugins
27
+
28
+ 🎨 **Formatting Included** - Uses [ESLint Stylistic](https://eslint.style/) instead of Prettier
29
+
30
+ 📦 **Multiple Formats** - Supports both flat config and legacy `.eslintrc`
31
+
32
+ 🔷 **TypeScript Ready** - Built-in TypeScript support
33
+
34
+ ⚛️ **Framework Support** - Dedicated configs for JSX-based frameworks, React and Vue.js
35
+
36
+ 🎯 **Flexible** - Choose from recommended, strict, or compatibility modes
37
+
38
+ 🔧 **Customizable** - Easy to override rules while maintaining the base style
39
+
40
+ ## Why
41
+
42
+ The original `eslint-config-airbnb` is not updated for a long time now, has compatibility issues and uses deprecated rules and plugins. This config addresses all of them:
43
+
44
+ - All deprecated rules are replaced with an updated alternatives
45
+ - All deprecated plugins removed or replaced with modern alternatives
46
+ - Any ESLint >= 8.57 is supported (including ESLint 9 of course)
47
+ - Both flat and legacy formats are supported
48
+ - TypeScript support
49
+ - Additional airbnb-inspired configs for other frameworks (JSX-based and Vue)
50
+
51
+ Big part of Airbnb codestyle are the formatting rules, so in order to follow airbnb codestyle as close as possible this config uses [ESLint Stylistic](https://eslint.style/) instead of `prettier`. Here is also a good article on this topic: [why not prettier](https://antfu.me/posts/why-not-prettier).
52
+
53
+ ## Prerequisites
54
+
55
+ - Node.js >= 16.x
56
+ - ESLint >= 8.57.0
57
+
58
+ ## Installation
59
+
60
+ Install the core packages:
61
+
62
+ ```bash
63
+ # npm
64
+ npm install -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb globals
65
+
66
+ # pnpm
67
+ pnpm add -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb globals
68
+
69
+ # yarn
70
+ yarn add -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb globals
11
71
  ```
12
72
 
13
- Add following to your eslint config:
73
+ ## Quickstart
74
+
75
+ You can either use flat `eslint.config.js` (recommended) or legacy `.eslintrc` (in case you need it) configs.
76
+
77
+ > ⚠️ **Important Note on Plugins**: You must explicitly include the recommended presets for any plugins you use.
78
+ >
79
+ > The configs provided by this package (e.g., `flat/react`, `flat/vue`) only contain styling rules and Airbnb-specific overrides. They do not enable the core logic/linting rules of the underlying plugins.
14
80
 
81
+ ### Flat Config (ESLint 9+)
82
+
83
+ **JavaScript:**
15
84
  ```javascript
16
- // Flat config
17
- // eslint.config.mjs
18
- import stylistic from '@stylistic/eslint-plugin';
85
+ // eslint.config.js
19
86
  import airbnb from 'eslint-stylistic-airbnb';
87
+ import globals from 'globals';
20
88
 
21
89
  export default [
22
- airbnb,
90
+ airbnb.configs['flat/recommended'],
91
+
23
92
  {
24
- files: ['**/*.{js,mjs,cjs,ts}'],
25
- plugins: {
26
- '@stylistic': stylistic,
93
+ languageOptions: {
94
+ globals: globals.browser,
27
95
  },
28
96
  },
29
97
  ];
30
98
  ```
31
99
 
100
+ **TypeScript:**
32
101
  ```javascript
33
- // Legacy config
34
- // .eslintrc.js
35
- module.exports = {
36
- plugins: ['@stylistic'],
37
- rules: {
38
- ...require('eslint-stylistic-airbnb').rules,
102
+ // eslint.config.js
103
+ import airbnb from 'eslint-stylistic-airbnb';
104
+ import tseslint from 'typescript-eslint';
105
+ import globals from 'globals';
106
+
107
+ export default [
108
+ ...tseslint.configs.recommended,
109
+
110
+ airbnb.configs['flat/recommended'],
111
+ airbnb.configs['flat/addon-typescript'],
112
+
113
+ {
114
+ languageOptions: {
115
+ globals: globals.browser,
116
+ },
39
117
  },
40
- parserOptions: {
41
- ecmaVersion: 'latest',
118
+ ];
119
+ ```
120
+
121
+ **React + JavaScript:**
122
+ ```javascript
123
+ // eslint.config.js
124
+ import airbnb from 'eslint-stylistic-airbnb';
125
+ import react from 'eslint-plugin-react';
126
+ import reactHooks from 'eslint-plugin-react-hooks';
127
+ import globals from 'globals';
128
+
129
+ export default [
130
+ react.configs.flat.recommended,
131
+ reactHooks.configs.recommended,
132
+
133
+ airbnb.configs['flat/recommended'],
134
+ airbnb.configs['flat/addon-jsx'],
135
+ airbnb.configs['flat/addon-react'],
136
+
137
+ {
138
+ languageOptions: {
139
+ globals: globals.browser,
140
+ },
42
141
  },
43
- };
142
+ ];
44
143
  ```
45
144
 
46
- # TypeScript
145
+ **React + TypeScript:**
146
+ ```javascript
147
+ // eslint.config.js
148
+ import airbnb from 'eslint-stylistic-airbnb';
149
+ import react from 'eslint-plugin-react';
150
+ import reactHooks from 'eslint-plugin-react-hooks';
151
+ import tseslint from 'typescript-eslint';
152
+ import globals from 'globals';
47
153
 
48
- If you use typescript, install additional dependency:
154
+ export default [
155
+ ...tseslint.configs.recommended,
156
+ react.configs.flat.recommended,
157
+ reactHooks.configs.recommended,
49
158
 
50
- ```shell
51
- npm install -D typescript-eslint
159
+ airbnb.configs['flat/recommended'],
160
+ airbnb.configs['flat/addon-typescript'],
161
+ airbnb.configs['flat/addon-jsx'],
162
+ airbnb.configs['flat/addon-react'],
163
+
164
+ {
165
+ languageOptions: {
166
+ globals: globals.browser,
167
+ },
168
+ },
169
+ ];
52
170
  ```
53
171
 
54
- And add following to your eslint config:
172
+ **Vue + JavaScript:**
173
+ ```javascript
174
+ // eslint.config.js
175
+ import airbnb from 'eslint-stylistic-airbnb';
176
+ import pluginVue from 'eslint-plugin-vue';
177
+ import globals from 'globals';
178
+
179
+ export default [
180
+ ...pluginVue.configs['flat/recommended'],
181
+
182
+ airbnb.configs['flat/recommended'],
183
+ airbnb.configs['flat/addon-vue'],
184
+
185
+ {
186
+ languageOptions: {
187
+ globals: globals.browser,
188
+ },
189
+ }
190
+ ];
191
+ ```
55
192
 
193
+ **Vue + TypeScript:**
56
194
  ```javascript
57
- // Flat config
58
- // eslint.config.mjs
59
- import tseslint from 'typescript-eslint';
60
- import stylistic from '@stylistic/eslint-plugin';
195
+ // eslint.config.js
61
196
  import airbnb from 'eslint-stylistic-airbnb';
197
+ import pluginVue from 'eslint-plugin-vue';
198
+ import tseslint from 'typescript-eslint';
199
+ import globals from 'globals';
62
200
 
63
201
  export default [
64
- airbnb,
65
202
  ...tseslint.configs.recommended,
203
+ ...pluginVue.configs['flat/recommended'],
204
+
205
+ airbnb.configs['flat/recommended'],
206
+ airbnb.configs['flat/addon-vue'],
207
+ airbnb.configs['flat/addon-typescript'],
208
+
66
209
  {
67
- files: ['**/*.{js,mjs,cjs,ts}'],
68
- plugins: {
69
- '@stylistic': stylistic,
210
+ languageOptions: {
211
+ globals: globals.browser,
70
212
  },
71
213
  },
72
214
  ];
73
215
  ```
74
216
 
217
+ ### Legacy Config (.eslintrc)
218
+
219
+ **JavaScript:**
75
220
  ```javascript
76
- // Legacy config
77
221
  // .eslintrc.js
78
222
  module.exports = {
79
- plugins: [
80
- '@typescript-eslint',
81
- '@stylistic',
223
+ extends: ['eslint-stylistic-airbnb/recommended'],
224
+ };
225
+ ```
226
+
227
+ **React + JavaScript:**
228
+ ```javascript
229
+ // .eslintrc.js
230
+ module.exports = {
231
+ extends: [
232
+ 'eslint-stylistic-airbnb/recommended',
233
+ 'plugin:react/recommended',
234
+ 'plugin:react-hooks/recommended',
82
235
  ],
83
- parser: '@typescript-eslint/parser',
236
+ };
237
+ ```
238
+
239
+ ## Configuration Reference
240
+
241
+ ### Base configs
242
+
243
+ Choose **one** of these as your foundation:
244
+
245
+ |Config|Config ID (Legacy)|Best For|Description|
246
+ |-|-|-|-|
247
+ |`flat/recommended`|`recommended`| New projects or gradual migration | All core Airbnb style rules: 2-space indentation, semicolons, trailing commas, single quotes, const/let over var, prefer-destructuring. Includes modern rules (`prefer-object-has-own`, `no-constant-binary-expression`) and TypeScript member delimiters. |
248
+ |`flat/strict`|`strict` | Maximum consistency enforcement | Everything in `recommended` **plus** stricter rules: disallows single-line ternaries, enforces function expressions over declarations, requires comments above code (not inline). ⚠️ May require refactoring. |
249
+ |`flat/compat`|`compat` | Upgrading from v1.x | Backward-compatible with previous package versions. Use when migrating to preserve existing behavior before adopting new rules. |
250
+
251
+ ### Addon configs
252
+
253
+ Add **any combination** of these to extend base configs:
254
+
255
+ |Config|Dependencies|Description|
256
+ |-|-|-|
257
+ |`flat/addon-typescript` | `typescript-eslint` | TypeScript-specific rule replacements: replaces base ESLint rules with TypeScript-aware versions for `no-shadow`, `no-unused-vars`, `no-use-before-define`, `no-useless-constructor`, `no-unused-expressions`, `prefer-destructuring`, and `prefer-promise-reject-errors` to prevent incorrect errors. |
258
+ |`flat/addon-jsx`| None | JSX/TSX formatting for React/Preact/Solid: PascalCase components, double quotes, 2-space indentation, self-closing tags, multiline wrapped in parens, one prop per line (multiline). |
259
+ |`flat/addoniterators`| None | Relaxes iterator restrictions: allows `for...of` loops. Still disallows `for...in`, `with` statements, and labeled statements. |
260
+ |`flat/addon-react` | `eslint-plugin-react` | React component rules: prop types validation, no deprecated APIs, component method ordering, lifecycle conventions, no array index keys, destructured props, function component style. |
261
+ |`flat/addon-vue` | `eslint-plugin-vue` | Vue 3 SFC conventions: block order (script/template/style), PascalCase naming, no useless mustaches/v-bind, boolean prop shorthand, separate static classes. |
262
+ |`flat/addon-vue-ts` | `eslint-plugin-vue`<br/>`typescript-eslint` | TypeScript in Vue: enforces `<script lang="ts">` and type-based prop definitions. Sets up TS parser for Vue files. |
263
+ | `flat/addon-import` | `eslint-plugin-import-x` | 🛠️ WIP 🛠️ Adds import-related rules |
264
+
265
+ ## Customizing Rules
266
+
267
+ You can override any rule to fit your project's needs:
268
+
269
+ **Flat Config:**
270
+ ```javascript
271
+ // eslint.config.js
272
+ import airbnb from 'eslint-stylistic-airbnb';
273
+
274
+ export default [
275
+ airbnb.configs['flat/recommended'],
276
+ {
277
+ rules: {
278
+ // Relax specific rules
279
+ '@stylistic/indent': ['error', 4], // Use 4 spaces instead of 2
280
+ 'no-console': 'warn', // Warn instead of error
281
+ 'max-len': ['error', { code: 120 }], // Increase line length
282
+ },
283
+ },
284
+ ];
285
+ ```
286
+
287
+ **Legacy Config:**
288
+ ```javascript
289
+ // .eslintrc.js
290
+ module.exports = {
291
+ extends: ['eslint-stylistic-airbnb/recommended'],
84
292
  rules: {
85
- ...require('eslint-stylistic-airbnb').rules,
293
+ '@stylistic/indent': ['error', 4],
294
+ 'no-console': 'warn',
295
+ 'max-len': ['error', { code: 120 }],
86
296
  },
87
297
  };
88
298
  ```
89
299
 
90
- # Notes
300
+ ## TypeScript Support
301
+
302
+ This config works with TypeScript out of the box. For TypeScript projects, you'll need to configure the parser, the preferred way is to use `typescript-eslint` config:
303
+
304
+ **Flat Config:**
305
+ ```javascript
306
+ // eslint.config.js
307
+ import airbnb from 'eslint-stylistic-airbnb';
308
+ import tseslint from 'typescript-eslint';
309
+
310
+ export default [
311
+ ...tseslint.configs.recommended,
312
+ airbnb.configs['flat/recommended'],
313
+ airbnb.configs['flat/addon-typescript'],
314
+ ];
315
+ ```
316
+
317
+ Make sure to include `addon-typescript` to prevent incorrect errors in TypeScript files.
318
+
319
+ ## Migration Guide
320
+
321
+ ### From `eslint-config-airbnb`
322
+
323
+ 1. **Uninstall the old package:**
324
+ ```bash
325
+ npm uninstall eslint-config-airbnb eslint-config-airbnb-base
326
+ ```
327
+
328
+ 2. **Install this package** (see [Installation](#installation))
329
+
330
+ 3. **Update your config:**
331
+ - Flat config: Replace `airbnb` with `airbnb.configs['flat/recommended']`
332
+ - Legacy: Replace `'airbnb'` with `'eslint-stylistic-airbnb/recommended'`
333
+
334
+ 4. **Remove Prettier** (if using):
335
+ ```bash
336
+ npm uninstall prettier eslint-config-prettier eslint-plugin-prettier
337
+ ```
338
+
339
+ 5. **Test and adjust** rules as needed
340
+
341
+ ### From v2.x of this package
342
+
343
+ Use the `flat/compat` or `compat` config to maintain v2.x behavior:
344
+
345
+ ```javascript
346
+ // eslint.config.js (flat config)
347
+ import airbnb from 'eslint-stylistic-airbnb';
348
+
349
+ export default [
350
+ airbnb.configs['flat/compat'],
351
+ ];
352
+ ```
353
+
354
+ ```javascript
355
+ // .eslintrc.js (legacy config)
356
+ module.exports = {
357
+ extends: ['eslint-stylistic-airbnb/compat'],
358
+ };
359
+ ```
360
+
361
+ ## Troubleshooting
362
+
363
+ ### Conflicts with Prettier
364
+
365
+ This config is designed to **replace** Prettier. If you have Prettier installed:
366
+
367
+ 1. Remove Prettier and related ESLint plugins
368
+ 2. Remove `.prettierrc` and `prettier.config.js`
369
+ 3. Update your IDE to use ESLint for formatting instead of Prettier
370
+
371
+ ### Plugin Not Found Errors
372
+
373
+ Ensure you've installed the required peer dependencies for the configs you're using:
374
+
375
+ - `flat/react` requires: `eslint-plugin-react`
376
+ - `flat/vue` requires: `eslint-plugin-vue`
377
+ - `flat/vue-ts` requires: `eslint-plugin-vue` and `typescript-eslint`
378
+
379
+ ### TypeScript Parsing Errors
380
+
381
+ Make sure that you use any of `typescript-eslint` configs:
382
+
383
+ ```javascript
384
+ import tseslint from 'typescript-eslint';
385
+
386
+ export default [
387
+ ...tseslint.configs.recommended,
388
+ ];
389
+ ```
390
+
391
+ ## FAQ
392
+
393
+ ### Should I use this instead of Prettier?
394
+
395
+ Yes! This config provides formatting through ESLint rules using [ESLint Stylistic](https://eslint.style/), which more closely matches the original styleguide and provides better integration with your linting workflow. See [Why I don't use Prettier](https://antfu.me/posts/why-not-prettier) for more context.
396
+
397
+ ### Can I use this with TypeScript?
398
+
399
+ Absolutely! This config works with TypeScript out of the box. See the [TypeScript Support](#typescript-support) section for setup instructions.
400
+
401
+ ### Which base config should I choose?
402
+
403
+ - **`flat/recommended`** - Best for most projects. Includes all essential Airbnb rules with modern additions.
404
+ - **`flat/strict`** - If you want to follow styleguide more closely and if you are willing to refactor code to meet stricter formatting rules.
405
+ - **`flat/compat`** - Only if migrating from v2.x of this package.
406
+
407
+ ### Do I need to install React/Vue plugins?
408
+
409
+ Only if you're using the React or Vue addons. The base config works standalone for JavaScript/TypeScript projects.
410
+
411
+ ### Why do I get "plugin not found" errors?
412
+
413
+ Make sure you've installed the peer dependencies for any addon configs you're using. See [Configuration Reference](#configuration-reference) for the complete list of optional dependencies.
414
+
415
+ ### Can I override specific rules?
416
+
417
+ Yes! See the [Customizing Rules](#customizing-rules) section for examples.
418
+
419
+ ### Is this compatible with ESLint 9?
420
+
421
+ Yes, ESLint 9 is fully supported using the flat config format.
422
+
423
+ ### Do I need to use a `recommended` config from `@eslint/js`?
424
+
425
+ No, all recommended rules are already included in the base airbnb config. You don't need to add `@eslint/js` recommended preset separately.
426
+
427
+ ### Why do I have `no-undef` errors?
428
+
429
+ Make sure to specify globals via the `languageOptions.globals` property in your flat config. For example, to enable browser globals:
430
+
431
+ ```javascript
432
+ // eslint.config.js
433
+ import airbnb from 'eslint-stylistic-airbnb';
434
+ import globals from 'globals';
435
+
436
+ export default [
437
+ airbnb.configs['flat/recommended'],
438
+
439
+ {
440
+ languageOptions: {
441
+ globals: globals.browser,
442
+ },
443
+ },
444
+ ];
445
+ ```
446
+
447
+ You can also combine multiple environments: `{ ...globals.browser, ...globals.node }`. See the [globals package](https://www.npmjs.com/package/globals) for available options.
448
+
449
+ ### How do I migrate from `eslint-config-airbnb`?
450
+
451
+ See the [Migration Guide](#migration-guide) for step-by-step instructions.
452
+
453
+ ## Contributing
454
+
455
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
456
+
457
+ ## License
458
+
459
+ [MIT](https://opensource.org/licenses/MIT)
460
+
461
+ ## Credits
462
+
463
+ - Based on the original [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
464
+ - Uses [@stylistic/eslint-plugin](https://eslint.style/) for formatting rules
465
+ - Inspired by the philosophy of [Why I don't use Prettier](https://antfu.me/posts/why-not-prettier) by Anthony Fu
91
466
 
92
- This config is created from the base airbnb config as is, with no changes to original rules
467
+ ## Related Links
93
468
 
94
- - rules that required newer eslint version are enabled
95
- - node related rules are not implemented
96
- - import rules are not implemented
97
- - react rules are not implemented (except of some jsx style options)
98
- - `func-style` rule is turned off, just like in original config (airbnb config contradicts with airbnb styleguide, this
99
- option set to be "backward-compatible")
469
+ - [ESLint Documentation](https://eslint.org/)
470
+ - [ESLint Stylistic](https://eslint.style/)
471
+ - [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
472
+ - [Original eslint-config-airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb)
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const rules = require('./flat/addon-iterators');
4
+
5
+ module.exports = {
6
+ rules,
7
+ };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const rules = require('./flat/addon-jsx');
4
+
5
+ module.exports = {
6
+ plugins: ['@stylistic'],
7
+ rules,
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ jsx: true,
11
+ },
12
+ },
13
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const rules = require('./flat/addon-react');
4
+
5
+ module.exports = {
6
+ rules,
7
+ };
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ const { rules } = require('./flat/compat');
4
+
5
+ module.exports = {
6
+ plugins: ['@stylistic'],
7
+ rules,
8
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const rules = require('../../rules/import').rules;
4
+
5
+ module.exports = {
6
+ rules,
7
+ };
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ name: 'airbnb:addon-iterators',
5
+ rules: {
6
+ 'no-restricted-syntax': [
7
+ 'error',
8
+ {
9
+ selector: 'ForInStatement',
10
+ message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
11
+ },
12
+ {
13
+ selector: 'LabeledStatement',
14
+ message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
15
+ },
16
+ {
17
+ selector: 'WithStatement',
18
+ message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
19
+ },
20
+ ],
21
+ },
22
+ };
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ // https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js
4
+
5
+ module.exports = {
6
+ name: 'airbnb:addon-jsx',
7
+ plugins: {
8
+ get ['@stylistic']() {
9
+ return require('@stylistic/eslint-plugin');
10
+ },
11
+ },
12
+ rules: {
13
+ '@stylistic/jsx-pascal-case': ['error', { allowAllCaps: true }],
14
+ "@stylistic/jsx-closing-tag-location": "error",
15
+ "@stylistic/jsx-closing-bracket-location": ["error", "line-aligned"],
16
+ '@stylistic/jsx-quotes': ['error', 'prefer-double'],
17
+ '@stylistic/jsx-curly-spacing': ["error", { when: 'never', allowMultiline: true }],
18
+ '@stylistic/jsx-wrap-multilines': ['error', {
19
+ declaration: 'parens-new-line',
20
+ assignment: 'parens-new-line',
21
+ return: 'parens-new-line',
22
+ arrow: 'parens-new-line',
23
+ condition: 'parens-new-line',
24
+ logical: 'parens-new-line',
25
+ prop: 'parens-new-line',
26
+ }],
27
+ '@stylistic/jsx-self-closing-comp': 'error',
28
+ // deprecated, but still needed for a proper formatting
29
+ '@stylistic/jsx-indent': ['error', 2],
30
+ '@stylistic/jsx-indent-props': ['error', 2],
31
+ '@stylistic/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
32
+ '@stylistic/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
33
+ '@stylistic/jsx-equals-spacing': ['error', 'never'],
34
+ '@stylistic/jsx-tag-spacing': ['error', {
35
+ closingSlash: 'never',
36
+ beforeSelfClosing: 'always',
37
+ afterOpening: 'never',
38
+ beforeClosing: 'never',
39
+ }],
40
+ '@stylistic/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
41
+ '@stylistic/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
42
+ '@stylistic/jsx-curly-newline': ['error', {
43
+ multiline: 'consistent',
44
+ singleline: 'consistent',
45
+ }],
46
+ },
47
+ languageOptions: {
48
+ parserOptions: {
49
+ ecmaFeatures: {
50
+ jsx: true,
51
+ },
52
+ },
53
+ },
54
+ };