|
| 1 | +import { defineConfig, globalIgnores } from 'eslint/config' |
1 | 2 | import globals from 'globals' |
2 | | -import pluginJs from '@eslint/js' |
| 3 | +import js from '@eslint/js' |
3 | 4 | import pluginCypress from 'eslint-plugin-cypress' |
4 | 5 | import stylistic from '@stylistic/eslint-plugin' |
5 | 6 |
|
6 | | -export default [ |
7 | | - pluginJs.configs.recommended, |
8 | | - pluginCypress.configs.recommended, |
| 7 | +export default defineConfig([ |
| 8 | + globalIgnores([ |
| 9 | + 'dist/', |
| 10 | + 'examples/component-tests/dist/', |
| 11 | + 'examples/nextjs/.next/', |
| 12 | + 'examples/nextjs/build/', |
| 13 | + 'examples/nextjs/src/app/', |
| 14 | + 'examples/wait-on-vite/dist/', |
| 15 | + 'examples/**/.pnp.*', |
| 16 | + ]), |
9 | 17 | { |
10 | | - name: 'global-ignores', |
11 | | - ignores: [ |
12 | | - 'dist/', |
13 | | - 'examples/component-tests/dist/', |
14 | | - 'examples/nextjs/.next/', |
15 | | - 'examples/nextjs/build/', |
16 | | - 'examples/nextjs/src/app/', |
17 | | - 'examples/wait-on-vite/dist/', |
18 | | - 'examples/**/.pnp.*', |
19 | | - ], |
20 | | - }, |
21 | | - { |
22 | | - name: 'all-js', |
23 | | - languageOptions: { |
24 | | - globals: { |
25 | | - ...globals.browser, |
26 | | - ...globals.node, |
27 | | - }, |
28 | | - }, |
29 | | - }, |
30 | | - { |
31 | | - name: 'style', |
32 | 18 | files: ['eslint.config.mjs', 'examples/**/*.js'], |
33 | | - ...stylistic.configs.recommended, |
| 19 | + extends: |
| 20 | + [ |
| 21 | + js.configs.recommended, |
| 22 | + pluginCypress.configs.recommended, |
| 23 | + stylistic.configs.recommended, |
| 24 | + ], |
34 | 25 | rules: { |
35 | | - '@stylistic/indent': ['error', 2], |
| 26 | + '@stylistic/arrow-parens': ['error', 'always'], |
36 | 27 | '@stylistic/comma-dangle': ['error', 'always-multiline'], |
| 28 | + '@stylistic/indent': ['error', 2], |
37 | 29 | '@stylistic/quotes': ['error', 'single'], |
38 | 30 | '@stylistic/semi': ['error', 'never'], |
| 31 | + '@stylistic/space-before-function-paren': ['error', 'always'], |
| 32 | + }, |
| 33 | + languageOptions: { |
| 34 | + globals: globals.node, |
39 | 35 | }, |
40 | 36 | }, |
41 | | -] |
| 37 | +]) |
0 commit comments