@bitfactory/eslint-config 5.0.5 → 5.1.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
@@ -10,15 +10,17 @@
10
10
  This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set. Rules can be overridden if needed.
11
11
 
12
12
  > [!IMPORTANT]
13
- > From ESLint v9 the Flat Config file is the default. Because of this change update the `package.json` npm run scripts!
13
+ > **ESLint v9+ uses Flat Config (ESM) by default.** This package now provides Flat Config entry points (`index.flat.js`, `typescript.flat.js`, `vue.flat.js`) for modern usage. See [:rocket: ESLint v9+ Flat Config Usage](#rocket-eslint-v9-flat-config-usage) for details and examples.
14
14
  >
15
- > See also the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
15
+ > **Legacy CJS configs are still supported** for backward compatibility. If you use the legacy `.eslintrc.js` approach, you must set the environment variable `ESLINT_USE_FLAT_CONFIG=false` in your npm scripts. See [:rocket: CLI usage](#rocket-cli-usage) for examples.
16
16
  >
17
- > For now the `eslint` scripts can only be run with the `ESLINT_USE_FLAT_CONFIG=false` environment variable set like this. For examples how to add this to the `package.json`, please check out the [CLI usage documentation](#rocket-cli-usage).
17
+ > Choose the method that matches your ESLint version and project setup. Legacy will be deprecated in a next major version.
18
+ > See also the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
18
19
 
19
20
  - [@bitfactory/eslint-config](#bitfactoryeslint-config)
20
21
  - [:technologist: Development](#technologist-development)
21
22
  - [Publishing](#publishing)
23
+ - [Local Development Configs](#local-development-configs)
22
24
  - [:package: Installing](#package-installing)
23
25
  - [Vue.js projects](#vuejs-projects)
24
26
  - [TypeScript projects](#typescript-projects)
@@ -28,6 +30,12 @@ This is a shareable config for [ESLint](https://eslint.org). All the rules and c
28
30
  - [Visual Studio Code](#visual-studio-code)
29
31
  - [Additional Extensions](#additional-extensions)
30
32
  - [PhpStorm](#phpstorm)
33
+ - [:rocket: ESLint v9+ Flat Config Usage](#rocket-eslint-v9-flat-config-usage)
34
+ - [Flat Config Entry Points](#flat-config-entry-points)
35
+ - [Example: Using Only the Base Config](#example-using-only-the-base-config)
36
+ - [Example: TypeScript Project](#example-typescript-project)
37
+ - [Example: Vue Project](#example-vue-project)
38
+ - [Example: Combined Vue + TypeScript + JS](#example-combined-vue--typescript--js)
31
39
 
32
40
  ## :technologist: Development
33
41
 
@@ -42,6 +50,27 @@ Before publishing a new version:
42
50
 
43
51
  > **For detailed automation and release rules, see the [Bitfactory NPM Package Automation Rules](.cursor/rules/npm-package-shared.mdc).**
44
52
 
53
+ ### Local Development Configs
54
+
55
+ > The files `.eslintrc.cjs` and `eslint.config.js` are provided for local development and testing only. They are not included in the published npm package and are not intended for consumer use. Consumers of this package should use the shareable config files (`index.(m)js`, `typescript.(m)js`, `vue.(m)js`, etc.) as described in the usage instructions.
56
+
57
+ ### Debugging ESLint Configuration
58
+
59
+ For debugging ESLint configuration issues, rule conflicts, or understanding config behavior, use the official ESLint Config Inspector:
60
+
61
+ ```bash
62
+ npx @eslint/config-inspector
63
+ ```
64
+
65
+ **Use cases:**
66
+
67
+ - Debug rule conflicts and understand which rules are active
68
+ - Visualize how configs apply to different file patterns
69
+ - Help consumers troubleshoot configuration issues
70
+ - Generate visual documentation of rule sets
71
+
72
+ The inspector provides a web interface showing all active rules, plugins, and file matching patterns for your ESLint configuration.
73
+
45
74
  ## :package: Installing
46
75
 
47
76
  Include the config into your project:
@@ -154,6 +183,10 @@ module.exports = {
154
183
 
155
184
  ## :rocket: CLI usage
156
185
 
186
+ > [!WARNING]
187
+ > **You only need to set `ESLINT_USE_FLAT_CONFIG=false` in your scripts if you are using the legacy config (`.eslintrc.js`).**
188
+ > For Flat Config (`eslint.config.js` and `*.flat.js`), do not set this variable—ESLint v9+ uses Flat Config by default.
189
+
157
190
  To use ESLint in the command-line, add the following scripts to your projects `package.json`:
158
191
 
159
192
  ```json
@@ -289,3 +322,66 @@ Or import the following xml file:
289
322
  </TaskOptions>
290
323
  </TaskOptions>
291
324
  ```
325
+
326
+ ## :rocket: ESLint v9+ Flat Config Usage
327
+
328
+ > [!IMPORTANT]
329
+ > ESLint v9+ uses Flat Config by default. This package now provides ESM-based Flat Config entry points for modern usage, while legacy CJS configs remain for backward compatibility.
330
+
331
+ ### Flat Config Entry Points
332
+
333
+ - **Base JS config:** `index.flat.js`
334
+ - **TypeScript config:** `typescript.flat.js`
335
+ - **Vue config:** `vue.flat.js`
336
+
337
+ ### Example: Using Only the Base Config
338
+
339
+ Create an `eslint.config.js` in your project root:
340
+
341
+ ```js
342
+ import base from '@bitfactory/eslint-config/index.flat.js';
343
+
344
+ export default [
345
+ ...base,
346
+ ];
347
+ ```
348
+
349
+ ### Example: TypeScript Project
350
+
351
+ ```js
352
+ import base from '@bitfactory/eslint-config/index.flat.js';
353
+ import ts from '@bitfactory/eslint-config/typescript.flat.js';
354
+
355
+ export default [
356
+ ...base,
357
+ ...ts,
358
+ ];
359
+ ```
360
+
361
+ ### Example: Vue Project
362
+
363
+ ```js
364
+ import base from '@bitfactory/eslint-config/index.flat.js';
365
+ import vue from '@bitfactory/eslint-config/vue.flat.js';
366
+
367
+ export default [
368
+ ...base,
369
+ ...vue,
370
+ ];
371
+ ```
372
+
373
+ ### Example: Combined Vue + TypeScript + JS
374
+
375
+ ```js
376
+ import base from '@bitfactory/eslint-config/index.flat.js';
377
+ import ts from '@bitfactory/eslint-config/typescript.flat.js';
378
+ import vue from '@bitfactory/eslint-config/vue.flat.js';
379
+
380
+ export default [
381
+ ...base,
382
+ ...ts,
383
+ ...vue,
384
+ ];
385
+ ```
386
+
387
+ > You can combine these configs as needed, just like with the legacy CJS configs. Only import the ones you need for your project.
package/index.flat.js ADDED
@@ -0,0 +1,95 @@
1
+ // ESLint Flat Config for @bitfactory/eslint-config
2
+ // This file is for ESLint v9+ flat config support. The legacy config files remain for backward compatibility.
3
+
4
+ import js from '@eslint/js';
5
+ import stylistic from '@stylistic/eslint-plugin';
6
+ import jsdoc from 'eslint-plugin-jsdoc';
7
+ import unicorn from 'eslint-plugin-unicorn';
8
+ import importPlugin from 'eslint-plugin-import';
9
+ import babelParser from '@babel/eslint-parser';
10
+ import globals from 'globals';
11
+
12
+ import { errorsRules } from './rules/errors.flat.js';
13
+ import { es6Rules } from './rules/es6.flat.js';
14
+ import { jsdocRules } from './rules/jsdoc.flat.js';
15
+ import { practicesRules } from './rules/practices.flat.js';
16
+ import { styleRules } from './rules/style.flat.js';
17
+ import { stylisticRules } from './rules/stylistic.flat.js';
18
+ import { variablesRules } from './rules/variables.flat.js';
19
+
20
+ export default [
21
+ {
22
+ ignores: [
23
+ '!.stylelintrc.js',
24
+ '/.nuxt/**',
25
+ '/dist/**',
26
+ '/static/sw.*',
27
+ ],
28
+ },
29
+ stylistic.configs['recommended-flat'],
30
+ {
31
+ files: ['**/*.{js,mjs}'],
32
+ languageOptions: {
33
+ ecmaVersion: 2021,
34
+ sourceType: 'module',
35
+ parser: babelParser,
36
+ parserOptions: {
37
+ requireConfigFile: false,
38
+ },
39
+ globals: {
40
+ ...globals.node,
41
+ ...globals.browser,
42
+ },
43
+ },
44
+ plugins: {
45
+ '@stylistic': stylistic,
46
+ jsdoc,
47
+ unicorn,
48
+ 'import': importPlugin,
49
+ },
50
+ rules: {
51
+ ...js.configs.recommended.rules,
52
+ ...jsdocRules,
53
+ ...unicorn.configs.recommended.rules,
54
+ ...errorsRules,
55
+ ...es6Rules,
56
+ ...practicesRules,
57
+ ...styleRules,
58
+ ...stylisticRules,
59
+ ...variablesRules,
60
+ },
61
+ },
62
+ // .cjs files must always be parsed as scripts
63
+ {
64
+ files: ['**/*.cjs'],
65
+ languageOptions: {
66
+ ecmaVersion: 2021,
67
+ sourceType: 'script',
68
+ parser: babelParser,
69
+ parserOptions: {
70
+ requireConfigFile: false,
71
+ },
72
+ globals: {
73
+ ...globals.node,
74
+ ...globals.browser,
75
+ },
76
+ },
77
+ plugins: {
78
+ '@stylistic': stylistic,
79
+ jsdoc,
80
+ unicorn,
81
+ 'import': importPlugin,
82
+ },
83
+ rules: {
84
+ ...js.configs.recommended.rules,
85
+ ...jsdocRules,
86
+ ...unicorn.configs.recommended.rules,
87
+ ...errorsRules,
88
+ ...es6Rules,
89
+ ...practicesRules,
90
+ ...styleRules,
91
+ ...stylisticRules,
92
+ ...variablesRules,
93
+ },
94
+ },
95
+ ];
package/index.js CHANGED
@@ -26,6 +26,15 @@ module.exports = {
26
26
  '/static/sw.*',
27
27
  ],
28
28
  overrides: [
29
+ {
30
+ files: ['**/*.cjs'],
31
+ env: {
32
+ node: true,
33
+ },
34
+ parserOptions: {
35
+ sourceType: 'script',
36
+ },
37
+ },
29
38
  {
30
39
  files: ['**/*.js'],
31
40
  parser: '@babel/eslint-parser',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitfactory/eslint-config",
3
- "version": "5.0.5",
3
+ "version": "5.1.1",
4
4
  "description": "ESLint sharable config for Bitfactory projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -13,9 +13,12 @@
13
13
  "files": [
14
14
  "rules",
15
15
  "index.js",
16
- "README.md",
16
+ "index.flat.js",
17
17
  "typescript.js",
18
- "vue.js"
18
+ "typescript.flat.js",
19
+ "vue.js",
20
+ "vue.flat.js",
21
+ "README.md"
19
22
  ],
20
23
  "devDependencies": {
21
24
  "eslint": "9.29.0",
@@ -30,16 +33,19 @@
30
33
  "eslint": "^8.56.0 || ^9.0.0",
31
34
  "eslint-plugin-import": ">=2.31.0",
32
35
  "eslint-plugin-jsdoc": ">=47.0.0",
33
- "eslint-plugin-unicorn": ">=56.0.1 <57.0.0"
36
+ "eslint-plugin-unicorn": ">=56.0.1 <57.0.0",
37
+ "globals": ">=16.2.0"
34
38
  },
35
39
  "engines": {
36
40
  "node": "^20.9.0 || ^22.11.0"
37
41
  },
38
42
  "scripts": {
39
- "eslint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{cjs,js,mjs}'",
43
+ "eslint": "eslint '**/*.{cjs,js,mjs}'",
40
44
  "eslint:fix": "pnpm run eslint --fix",
41
- "lint": "pnpm run eslint",
42
- "lint:fix": "pnpm run eslint:fix",
45
+ "eslint:legacy": "ESLINT_USE_FLAT_CONFIG=false eslint -c .eslintrc.cjs '**/*.{cjs,js,mjs}' --ignore-pattern '**/*.flat.js' --ignore-pattern 'eslint.config.js'",
46
+ "eslint:legacy:fix": "pnpm run eslint:legacy --fix",
47
+ "lint": "pnpm run eslint && pnpm run eslint:legacy",
48
+ "lint:fix": "pnpm run eslint:fix && pnpm run eslint:legacy:fix",
43
49
  "update:interactive": "pnpm exec npm-check-updates -i",
44
50
  "update:minor": "pnpm exec npm-check-updates -i -t minor",
45
51
  "update:patch": "pnpm exec npm-check-updates -t patch"
@@ -0,0 +1,5 @@
1
+ export const errorsRules = {
2
+ 'no-await-in-loop': 'error',
3
+ 'no-console': 'error',
4
+ 'no-template-curly-in-string': 'error',
5
+ };
@@ -0,0 +1,38 @@
1
+ export const es6Plugins = [
2
+ 'import',
3
+ ];
4
+ export const es6Rules = {
5
+ 'arrow-body-style': ['error', 'as-needed'],
6
+ 'import/no-duplicates': ['error'],
7
+ 'no-duplicate-imports': [
8
+ 'error',
9
+ {
10
+ includeExports: true,
11
+ },
12
+ ],
13
+ 'no-useless-computed-key': 'error',
14
+ 'no-useless-rename': 'error',
15
+ 'no-var': 'error',
16
+ 'object-shorthand': [
17
+ 'error',
18
+ 'always',
19
+ {
20
+ avoidQuotes: true,
21
+ ignoreConstructors: true,
22
+ },
23
+ ],
24
+ 'prefer-arrow-callback': 'error',
25
+ 'prefer-const': 'error',
26
+ 'prefer-destructuring': [
27
+ 'error',
28
+ {
29
+ array: false,
30
+ object: true,
31
+ },
32
+ ],
33
+ 'prefer-numeric-literals': 'error',
34
+ 'prefer-rest-params': 'error',
35
+ 'prefer-spread': 'error',
36
+ 'prefer-template': 'error',
37
+ 'symbol-description': 'error',
38
+ };
@@ -0,0 +1,5 @@
1
+ export const jsdocRules = {
2
+ 'jsdoc/check-indentation': 'warn',
3
+ 'jsdoc/check-syntax': 'warn',
4
+ 'jsdoc/match-description': 'warn',
5
+ };
@@ -0,0 +1,62 @@
1
+ export const practicesRules = {
2
+ 'array-callback-return': 'error',
3
+ 'block-scoped-var': 'error',
4
+ 'complexity': ['error', 10],
5
+ 'consistent-return': 'error',
6
+ 'curly': ['error', 'all'],
7
+ 'dot-notation': 'error',
8
+ 'eqeqeq': 'error',
9
+ 'guard-for-in': 'error',
10
+ 'max-classes-per-file': 'error',
11
+ 'no-alert': 'error',
12
+ 'no-caller': 'error',
13
+ 'no-div-regex': 'error',
14
+ 'no-else-return': 'error',
15
+ 'no-empty-function': 'error',
16
+ 'no-eval': 'error',
17
+ 'no-extend-native': 'error',
18
+ 'no-extra-bind': 'error',
19
+ 'no-extra-label': 'error',
20
+ 'no-implicit-coercion': 'error',
21
+ 'no-implicit-globals': 'error',
22
+ 'no-implied-eval': 'error',
23
+ 'no-iterator': 'error',
24
+ 'no-labels': 'error',
25
+ 'no-lone-blocks': 'error',
26
+ 'no-loop-func': 'error',
27
+ 'no-multi-str': 'error',
28
+ 'no-new-func': 'error',
29
+ 'no-new-wrappers': 'error',
30
+ 'no-octal-escape': 'error',
31
+ 'no-param-reassign': 'error',
32
+ 'no-proto': 'error',
33
+ 'no-return-assign': 'warn',
34
+ 'no-return-await': 'error',
35
+ 'no-script-url': 'error',
36
+ 'no-self-compare': 'error',
37
+ 'no-sequences': 'error',
38
+ 'no-throw-literal': 'error',
39
+ 'no-unmodified-loop-condition': 'error',
40
+ 'no-unused-expressions': 'error',
41
+ 'no-useless-call': 'error',
42
+ 'no-useless-concat': 'error',
43
+ 'no-useless-return': 'error',
44
+ 'no-void': 'error',
45
+ 'no-warning-comments': 'error',
46
+ 'prefer-promise-reject-errors': 'error',
47
+ 'radix': 'error',
48
+ 'require-await': 'error',
49
+ 'unicorn/filename-case': [
50
+ 'error',
51
+ {
52
+ cases: {
53
+ kebabCase: true,
54
+ pascalCase: true,
55
+ },
56
+ },
57
+ ],
58
+ 'unicorn/no-null': 0,
59
+ 'unicorn/no-reduce': 0,
60
+ 'vars-on-top': 'error',
61
+ 'yoda': 'error',
62
+ };
@@ -0,0 +1,49 @@
1
+ export const styleRules = {
2
+ 'camelcase': 'error',
3
+ 'consistent-this': 'error',
4
+ 'func-name-matching': 'error',
5
+ 'func-names': ['error', 'never'],
6
+ 'func-style': 'error',
7
+ 'max-depth': 'error',
8
+ 'max-lines': 'warn',
9
+ 'max-lines-per-function': [
10
+ 'warn',
11
+ {
12
+ skipBlankLines: true,
13
+ skipComments: true,
14
+ },
15
+ ],
16
+ 'max-params': 'error',
17
+ 'max-statements': 'warn',
18
+ 'new-cap': 'error',
19
+ 'no-array-constructor': 'error',
20
+ 'no-lonely-if': 'error',
21
+ 'no-multi-assign': 'error',
22
+ 'no-negated-condition': 'error',
23
+ 'no-new-object': 'error',
24
+ 'no-plusplus': [
25
+ 'error',
26
+ {
27
+ allowForLoopAfterthoughts: true,
28
+ },
29
+ ],
30
+ 'no-underscore-dangle': [
31
+ 'error',
32
+ {
33
+ enforceInMethodNames: true,
34
+ },
35
+ ],
36
+ 'no-unneeded-ternary': [
37
+ 'error',
38
+ {
39
+ defaultAssignment: false,
40
+ },
41
+ ],
42
+ 'one-var': ['error', 'never'],
43
+ 'operator-assignment': 'error',
44
+ 'prefer-object-spread': 'error',
45
+ 'sort-imports': ['error', {
46
+ ignoreDeclarationSort: true,
47
+ }],
48
+ 'sort-vars': 'error',
49
+ };
@@ -0,0 +1,114 @@
1
+ export const stylisticRules = {
2
+ '@stylistic/array-bracket-newline': ['error', 'consistent'],
3
+ '@stylistic/array-bracket-spacing': 'error',
4
+ '@stylistic/array-element-newline': ['error', 'consistent'],
5
+ '@stylistic/arrow-parens': ['error', 'as-needed'],
6
+ '@stylistic/arrow-spacing': 'error',
7
+ '@stylistic/block-spacing': 'error',
8
+ '@stylistic/brace-style': ['error', '1tbs'],
9
+ '@stylistic/comma-dangle': ['error', 'always-multiline'],
10
+ '@stylistic/comma-spacing': 'error',
11
+ '@stylistic/comma-style': 'error',
12
+ '@stylistic/computed-property-spacing': 'error',
13
+ '@stylistic/eol-last': 'error',
14
+ '@stylistic/generator-star-spacing': ['error', 'after'],
15
+ '@stylistic/implicit-arrow-linebreak': 'error',
16
+ '@stylistic/indent': ['error', 4, {
17
+ SwitchCase: 1,
18
+ }],
19
+ '@stylistic/indent-binary-ops': ['error', 4],
20
+ '@stylistic/key-spacing': 'error',
21
+ '@stylistic/keyword-spacing': 'error',
22
+ '@stylistic/line-comment-position': 'error',
23
+ '@stylistic/linebreak-style': 'error',
24
+ '@stylistic/lines-between-class-members': 'error',
25
+ '@stylistic/max-len': ['warn', {
26
+ code: 120,
27
+ }],
28
+ '@stylistic/max-statements-per-line': 'error',
29
+ '@stylistic/member-delimiter-style': ['error', {
30
+ multiline: {
31
+ delimiter: 'semi',
32
+ requireLast: true,
33
+ },
34
+ singleline: {
35
+ delimiter: 'semi',
36
+ requireLast: false,
37
+ },
38
+ multilineDetection: 'brackets',
39
+ }],
40
+ '@stylistic/multiline-comment-style': ['error', 'separate-lines'],
41
+ '@stylistic/multiline-ternary': ['error', 'never'],
42
+ '@stylistic/new-parens': 'error',
43
+ '@stylistic/newline-per-chained-call': 'error',
44
+ '@stylistic/no-confusing-arrow': 'error',
45
+ '@stylistic/no-extra-parens': ['error', 'functions'],
46
+ '@stylistic/no-floating-decimal': 'error',
47
+ '@stylistic/no-mixed-operators': 'error',
48
+ '@stylistic/no-multi-spaces': 'error',
49
+ '@stylistic/no-multiple-empty-lines': ['error', {
50
+ max: 1,
51
+ }],
52
+ '@stylistic/no-tabs': 'error',
53
+ '@stylistic/no-trailing-spaces': 'error',
54
+ '@stylistic/no-whitespace-before-property': 'error',
55
+ '@stylistic/object-curly-newline': ['error', {
56
+ ExportDeclaration: {
57
+ minProperties: 2,
58
+ multiline: true,
59
+ },
60
+ ImportDeclaration: {
61
+ minProperties: 4,
62
+ multiline: true,
63
+ },
64
+ ObjectExpression: {
65
+ minProperties: 1,
66
+ multiline: true,
67
+ },
68
+ ObjectPattern: {
69
+ minProperties: 4,
70
+ multiline: true,
71
+ },
72
+ }],
73
+ '@stylistic/object-curly-spacing': ['error', 'always'],
74
+ '@stylistic/object-property-newline': 'error',
75
+ '@stylistic/one-var-declaration-per-line': ['error', 'always'],
76
+ '@stylistic/operator-linebreak': ['error', 'after'],
77
+ '@stylistic/padding-line-between-statements': ['error', {
78
+ blankLine: 'always',
79
+ next: 'return',
80
+ prev: '*',
81
+ }],
82
+ '@stylistic/rest-spread-spacing': 'error',
83
+ '@stylistic/quote-props': ['error', 'consistent-as-needed'],
84
+ '@stylistic/quotes': ['error', 'single', {
85
+ allowTemplateLiterals: false,
86
+ avoidEscape: true,
87
+ }],
88
+ '@stylistic/semi': ['error', 'always'],
89
+ '@stylistic/semi-style': 'error',
90
+ '@stylistic/space-before-blocks': 'error',
91
+ '@stylistic/space-before-function-paren': ['error', 'never'],
92
+ '@stylistic/space-in-parens': 'error',
93
+ '@stylistic/space-infix-ops': 'error',
94
+ '@stylistic/space-unary-ops': ['error', {
95
+ nonwords: false,
96
+ words: true,
97
+ }],
98
+ '@stylistic/spaced-comment': 'error',
99
+ '@stylistic/switch-colon-spacing': 'error',
100
+ '@stylistic/template-curly-spacing': 'error',
101
+ '@stylistic/template-tag-spacing': 'error',
102
+ '@stylistic/type-annotation-spacing': ['error', {
103
+ before: false,
104
+ after: true,
105
+ overrides: {
106
+ arrow: {
107
+ before: true,
108
+ after: true,
109
+ },
110
+ },
111
+ }],
112
+ '@stylistic/wrap-regex': 'error',
113
+ '@stylistic/yield-star-spacing': ['error', 'after'],
114
+ };
@@ -0,0 +1,7 @@
1
+ export const variablesRules = {
2
+ 'init-declarations': 'error',
3
+ 'no-label-var': 'error',
4
+ 'no-undef-init': 'error',
5
+ 'no-undefined': 'error',
6
+ 'no-use-before-define': 'error',
7
+ };
@@ -0,0 +1,26 @@
1
+ export const vueRules = {
2
+ 'vuejs-accessibility/media-has-caption': 'off',
3
+ 'vue/block-tag-newline': [
4
+ 'error',
5
+ {
6
+ multiline: 'always',
7
+ singleline: 'always',
8
+ },
9
+ ],
10
+ 'vue/component-name-in-template-casing': [
11
+ 'error',
12
+ 'PascalCase',
13
+ {
14
+ registeredComponentsOnly: false,
15
+ },
16
+ ],
17
+ 'vue/attributes-order': ['error', {
18
+ alphabetical: true,
19
+ }],
20
+ 'vue/html-indent': ['error', 4],
21
+ 'vue/no-empty-component-block': 'error',
22
+ 'vue/no-template-target-blank': 'error',
23
+ 'vue/padding-line-between-blocks': ['error', 'always'],
24
+ 'vue/singleline-html-element-content-newline': 'off',
25
+ 'vue/v-on-function-call': 'error',
26
+ };
@@ -0,0 +1,27 @@
1
+ import baseConfig from './index.flat.js';
2
+ import ts from '@typescript-eslint/eslint-plugin';
3
+ import tsParser from '@typescript-eslint/parser';
4
+
5
+ export default [
6
+ ...baseConfig,
7
+ ...ts.configs.recommended,
8
+ {
9
+ files: ['**/*.ts', '**/*.tsx'],
10
+ languageOptions: {
11
+ parser: tsParser,
12
+ },
13
+ plugins: {
14
+ '@typescript-eslint': ts,
15
+ },
16
+ rules: {
17
+ '@typescript-eslint/consistent-type-imports': [
18
+ 'warn',
19
+ {
20
+ fixStyle: 'inline-type-imports',
21
+ prefer: 'type-imports',
22
+ },
23
+ ],
24
+ 'no-duplicate-imports': 'off',
25
+ },
26
+ },
27
+ ];
package/vue.flat.js ADDED
@@ -0,0 +1,28 @@
1
+ import baseConfig from './index.flat.js';
2
+ import vue from 'eslint-plugin-vue';
3
+ import vueA11y from 'eslint-plugin-vuejs-accessibility';
4
+ import vueParser from 'vue-eslint-parser';
5
+ import babelParser from '@babel/eslint-parser';
6
+ import { vueRules } from './rules/vue.flat.js';
7
+
8
+ export default [
9
+ ...baseConfig,
10
+ ...vue.configs['flat/recommended'],
11
+ ...vueA11y.configs['flat/recommended'],
12
+ {
13
+ files: ['**/*.vue'],
14
+ languageOptions: {
15
+ parser: vueParser,
16
+ parserOptions: {
17
+ parser: babelParser,
18
+ },
19
+ },
20
+ plugins: {
21
+ vue,
22
+ 'vuejs-accessibility': vueA11y,
23
+ },
24
+ rules: {
25
+ ...vueRules,
26
+ },
27
+ },
28
+ ];