@ntnyq/eslint-config 2.0.0-beta.1 → 2.0.0-beta.11
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 +23 -1
- package/dist/index.d.ts +80 -0
- package/dist/index.js +1029 -0
- package/package.json +53 -37
- package/index.js +0 -9
- package/lib/astro.js +0 -24
- package/lib/eslint-comments.js +0 -14
- package/lib/js.js +0 -156
- package/lib/jsonc.js +0 -115
- package/lib/markdown.js +0 -44
- package/lib/presets.js +0 -24
- package/lib/prettier.js +0 -19
- package/lib/shared.js +0 -61
- package/lib/ts.js +0 -70
- package/lib/vue.js +0 -23
- package/lib/yml.js +0 -22
package/package.json
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
5
|
-
"packageManager": "pnpm@
|
|
6
|
-
"description": "",
|
|
7
|
-
"keywords": [
|
|
4
|
+
"version": "2.0.0-beta.11",
|
|
5
|
+
"packageManager": "pnpm@8.6.2",
|
|
6
|
+
"description": "ESLint flat config of ntnyq",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"eslint",
|
|
9
|
+
"eslint-config",
|
|
10
|
+
"eslint-flat-config",
|
|
11
|
+
"ntnyq"
|
|
12
|
+
],
|
|
8
13
|
"license": "MIT",
|
|
9
14
|
"author": {
|
|
10
15
|
"name": "ntnyq",
|
|
11
16
|
"email": "ntnyq13@gmail.com"
|
|
12
17
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"require": "./index.js",
|
|
19
|
-
"import": "./index.js"
|
|
20
|
-
},
|
|
18
|
+
"repository": "ntnyq/eslint-config",
|
|
19
|
+
"exports": "./dist/index.js",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"module": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
21
23
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"lib"
|
|
24
|
+
"dist"
|
|
24
25
|
],
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
@@ -29,42 +30,57 @@
|
|
|
29
30
|
"eslint": "^8.30.0"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@eslint/js": "^8.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
34
|
-
"@typescript-eslint/parser": "^5.
|
|
35
|
-
"astro-eslint-parser": "^0.
|
|
36
|
-
"eslint-config-prettier": "^8.
|
|
37
|
-
"eslint-
|
|
33
|
+
"@eslint/js": "^8.43.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
35
|
+
"@typescript-eslint/parser": "^5.59.11",
|
|
36
|
+
"astro-eslint-parser": "^0.14.0",
|
|
37
|
+
"eslint-config-prettier": "^8.8.0",
|
|
38
|
+
"eslint-define-config": "^1.20.0",
|
|
39
|
+
"eslint-plugin-astro": "^0.27.1",
|
|
38
40
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
39
41
|
"eslint-plugin-import": "^2.27.5",
|
|
40
|
-
"eslint-plugin-jsonc": "^2.
|
|
42
|
+
"eslint-plugin-jsonc": "^2.9.0",
|
|
41
43
|
"eslint-plugin-markdown": "^3.0.0",
|
|
42
44
|
"eslint-plugin-prettier": "^4.2.1",
|
|
43
|
-
"eslint-plugin-
|
|
44
|
-
"eslint-plugin-
|
|
45
|
-
"eslint-plugin-
|
|
45
|
+
"eslint-plugin-react": "^7.32.2",
|
|
46
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
47
|
+
"eslint-plugin-unicorn": "^47.0.0",
|
|
48
|
+
"eslint-plugin-vue": "^9.15.0",
|
|
49
|
+
"eslint-plugin-yml": "^1.8.0",
|
|
46
50
|
"globals": "^13.20.0",
|
|
47
|
-
"jsonc-eslint-parser": "^2.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
+
"jsonc-eslint-parser": "^2.3.0",
|
|
52
|
+
"local-pkg": "^0.4.3",
|
|
53
|
+
"prettier": "^2.8.8",
|
|
54
|
+
"vue-eslint-parser": "^9.3.1",
|
|
55
|
+
"yaml-eslint-parser": "^1.2.2"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|
|
53
|
-
"@ntnyq/prettier-config": "^1.
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"bumpp": "^9.
|
|
56
|
-
"eslint": "^8.
|
|
57
|
-
"eslint-define-config": "^1.15.0",
|
|
58
|
+
"@ntnyq/prettier-config": "^1.9.0",
|
|
59
|
+
"@types/node": "^20.3.1",
|
|
60
|
+
"bumpp": "^9.1.1",
|
|
61
|
+
"eslint": "^8.43.0",
|
|
58
62
|
"husky": "^8.0.3",
|
|
59
63
|
"nano-staged": "^0.8.0",
|
|
60
|
-
"
|
|
64
|
+
"npm-run-all": "^4.1.5",
|
|
65
|
+
"pnpm": "^8.6.2",
|
|
66
|
+
"rimraf": "^5.0.1",
|
|
67
|
+
"tsup": "^7.0.0",
|
|
68
|
+
"typescript": "5.1.3"
|
|
61
69
|
},
|
|
62
70
|
"engines": {
|
|
63
|
-
"node": ">=14.
|
|
71
|
+
"node": ">=16.14.0"
|
|
64
72
|
},
|
|
65
73
|
"prettier": "@ntnyq/prettier-config",
|
|
74
|
+
"nano-staged": {
|
|
75
|
+
"*.{js,ts,json,jsonc,md,yaml,yml}": "pnpm run lint --fix"
|
|
76
|
+
},
|
|
66
77
|
"scripts": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
78
|
+
"build": "tsup",
|
|
79
|
+
"clean": "rimraf dist",
|
|
80
|
+
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint .",
|
|
81
|
+
"release": "run-s release:check release:version",
|
|
82
|
+
"release:check": "run-s clean build lint typecheck",
|
|
83
|
+
"release:version": "bumpp && pnpm publish --tag next",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
69
85
|
}
|
|
70
86
|
}
|
package/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './lib/js.js'
|
|
2
|
-
export * from './lib/ts.js'
|
|
3
|
-
export * from './lib/yml.js'
|
|
4
|
-
export * from './lib/vue.js'
|
|
5
|
-
export * from './lib/astro.js'
|
|
6
|
-
export * from './lib/jsonc.js'
|
|
7
|
-
export * from './lib/prettier.js'
|
|
8
|
-
export * from './lib/markdown.js'
|
|
9
|
-
export * from './lib/eslint-comments.js'
|
package/lib/astro.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import astroPlugin, { configs } from 'eslint-plugin-astro'
|
|
2
|
-
import astroParser from 'astro-eslint-parser'
|
|
3
|
-
import { GLOB_EXCLUDE, GLOB_ASTRO } from './shared.js'
|
|
4
|
-
|
|
5
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
6
|
-
export const astro = [
|
|
7
|
-
{
|
|
8
|
-
files: [GLOB_ASTRO],
|
|
9
|
-
ignores: GLOB_EXCLUDE,
|
|
10
|
-
plugins: {
|
|
11
|
-
astro: astroPlugin,
|
|
12
|
-
},
|
|
13
|
-
languageOptions: {
|
|
14
|
-
parser: astroParser,
|
|
15
|
-
parserOptions: {
|
|
16
|
-
parser: '@typescript-eslint/parser',
|
|
17
|
-
extraFileExtensions: ['.astro'],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
...configs.recommended,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
]
|
package/lib/eslint-comments.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import commentsPlugin from 'eslint-plugin-eslint-comments'
|
|
2
|
-
|
|
3
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
4
|
-
export const eslintComments = [
|
|
5
|
-
{
|
|
6
|
-
plugins: {
|
|
7
|
-
'eslint-comments': commentsPlugin,
|
|
8
|
-
},
|
|
9
|
-
rules: {
|
|
10
|
-
...commentsPlugin.configs.recommended.rules,
|
|
11
|
-
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
]
|
package/lib/js.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import globals from 'globals'
|
|
2
|
-
import jsConfig from '@eslint/js'
|
|
3
|
-
import importPlugin from 'eslint-plugin-import'
|
|
4
|
-
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
5
|
-
import { GLOB_EXCLUDE } from './shared.js'
|
|
6
|
-
|
|
7
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
8
|
-
export const js = [
|
|
9
|
-
jsConfig.configs.recommended,
|
|
10
|
-
{
|
|
11
|
-
languageOptions: {
|
|
12
|
-
globals: {
|
|
13
|
-
...globals.browser,
|
|
14
|
-
...globals.es2021,
|
|
15
|
-
...globals.node,
|
|
16
|
-
},
|
|
17
|
-
sourceType: 'module',
|
|
18
|
-
},
|
|
19
|
-
rules: {},
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
files: ['**/scripts/*', '**/cli.*'],
|
|
24
|
-
ignores: GLOB_EXCLUDE,
|
|
25
|
-
rules: {
|
|
26
|
-
'no-console': 'off',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
files: ['**/*.{test,spec}.js?(x)'],
|
|
32
|
-
rules: {
|
|
33
|
-
'no-unused-expressions': 'off',
|
|
34
|
-
'max-lines-per-function': 'off',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
40
|
-
export const jsx = [
|
|
41
|
-
{
|
|
42
|
-
files: ['**/*.jsx'],
|
|
43
|
-
ignores: GLOB_EXCLUDE,
|
|
44
|
-
languageOptions: {
|
|
45
|
-
parserOptions: {
|
|
46
|
-
ecmaFeatures: {
|
|
47
|
-
jsx: true,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
55
|
-
export const imports = [
|
|
56
|
-
{
|
|
57
|
-
plugins: {
|
|
58
|
-
import: importPlugin,
|
|
59
|
-
},
|
|
60
|
-
settings: {
|
|
61
|
-
'import/resolver': {
|
|
62
|
-
node: { extensions: ['.js', '.mjs', '.ts', '.d.ts'] },
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
rules: {
|
|
66
|
-
'import/first': 'error',
|
|
67
|
-
'import/no-mutable-exports': 'error',
|
|
68
|
-
'import/no-duplicates': 'error',
|
|
69
|
-
'import/order': [
|
|
70
|
-
'error',
|
|
71
|
-
{
|
|
72
|
-
groups: [
|
|
73
|
-
'builtin',
|
|
74
|
-
'external',
|
|
75
|
-
'internal',
|
|
76
|
-
'parent',
|
|
77
|
-
'sibling',
|
|
78
|
-
'index',
|
|
79
|
-
'object',
|
|
80
|
-
'type',
|
|
81
|
-
],
|
|
82
|
-
pathGroups: [{ pattern: '@/**', group: 'internal' }],
|
|
83
|
-
pathGroupsExcludedImportTypes: ['type'],
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
]
|
|
89
|
-
|
|
90
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
91
|
-
export const unicorn = [
|
|
92
|
-
{
|
|
93
|
-
plugins: {
|
|
94
|
-
unicorn: unicornPlugin,
|
|
95
|
-
},
|
|
96
|
-
rules: {
|
|
97
|
-
'unicorn/no-unsafe-regex': 'off',
|
|
98
|
-
|
|
99
|
-
'unicorn/error-message': 'error',
|
|
100
|
-
'unicorn/escape-case': 'error',
|
|
101
|
-
'unicorn/no-new-buffer': 'error',
|
|
102
|
-
'unicorn/number-literal-case': 'error',
|
|
103
|
-
'unicorn/prefer-includes': 'error',
|
|
104
|
-
'unicorn/prefer-type-error': 'error',
|
|
105
|
-
'unicorn/throw-new-error': 'error',
|
|
106
|
-
'unicorn/no-unnecessary-await': 'error',
|
|
107
|
-
'unicorn/switch-case-braces': ['error', 'avoid'],
|
|
108
|
-
'unicorn/no-typeof-undefined': 'error',
|
|
109
|
-
'unicorn/prefer-set-size': 'error',
|
|
110
|
-
'unicorn/better-regex': 'error',
|
|
111
|
-
'unicorn/custom-error-definition': 'error',
|
|
112
|
-
'unicorn/explicit-length-check': 'error',
|
|
113
|
-
'unicorn/new-for-builtins': 'error',
|
|
114
|
-
'unicorn/no-console-spaces': 'error',
|
|
115
|
-
'unicorn/no-for-loop': 'error',
|
|
116
|
-
'unicorn/no-hex-escape': 'error',
|
|
117
|
-
'unicorn/no-lonely-if': 'error',
|
|
118
|
-
'unicorn/prefer-keyboard-event-key': 'error',
|
|
119
|
-
'unicorn/prefer-math-trunc': 'error',
|
|
120
|
-
'unicorn/prefer-negative-index': 'error',
|
|
121
|
-
'unicorn/prefer-node-protocol': 'error',
|
|
122
|
-
'unicorn/prefer-number-properties': 'error',
|
|
123
|
-
'unicorn/prefer-optional-catch-binding': 'error',
|
|
124
|
-
'unicorn/prefer-prototype-methods': 'error',
|
|
125
|
-
'unicorn/prefer-reflect-apply': 'error',
|
|
126
|
-
|
|
127
|
-
'unicorn/prefer-date-now': 'error',
|
|
128
|
-
|
|
129
|
-
// String
|
|
130
|
-
'unicorn/prefer-string-slice': 'error',
|
|
131
|
-
'unicorn/prefer-string-trim-start-end': 'error',
|
|
132
|
-
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
133
|
-
|
|
134
|
-
// DOM
|
|
135
|
-
'unicorn/prefer-add-event-listener': 'error',
|
|
136
|
-
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
137
|
-
'unicorn/prefer-query-selector': 'error',
|
|
138
|
-
'unicorn/prefer-modern-dom-apis': 'error',
|
|
139
|
-
'unicorn/prefer-dom-node-append': 'error',
|
|
140
|
-
'unicorn/prefer-dom-node-dataset': 'error',
|
|
141
|
-
'unicorn/prefer-dom-node-remove': 'error',
|
|
142
|
-
'unicorn/prefer-dom-node-text-content': 'error',
|
|
143
|
-
|
|
144
|
-
// Array
|
|
145
|
-
'unicorn/no-new-array': 'error',
|
|
146
|
-
'unicorn/no-instanceof-array': 'error',
|
|
147
|
-
'unicorn/no-array-push-push': 'error',
|
|
148
|
-
'unicorn/no-array-callback-reference': 'error',
|
|
149
|
-
'unicorn/no-array-method-this-argument': 'error',
|
|
150
|
-
'unicorn/prefer-array-find': 'error',
|
|
151
|
-
'unicorn/prefer-array-some': 'error',
|
|
152
|
-
'unicorn/prefer-array-flat-map': 'error',
|
|
153
|
-
'unicorn/prefer-array-index-of': 'error',
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
]
|
package/lib/jsonc.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import jsoncPlugin, { configs } from 'eslint-plugin-jsonc'
|
|
2
|
-
import jsoncParser from 'jsonc-eslint-parser'
|
|
3
|
-
import { GLOB_EXCLUDE, GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from './shared.js'
|
|
4
|
-
|
|
5
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
6
|
-
export const jsonc = [
|
|
7
|
-
{
|
|
8
|
-
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, '**/*rc'],
|
|
9
|
-
ignores: GLOB_EXCLUDE,
|
|
10
|
-
plugins: {
|
|
11
|
-
jsonc: jsoncPlugin,
|
|
12
|
-
},
|
|
13
|
-
languageOptions: {
|
|
14
|
-
parser: jsoncParser,
|
|
15
|
-
},
|
|
16
|
-
rules: {
|
|
17
|
-
...configs['recommended-with-jsonc'].rules,
|
|
18
|
-
'jsonc/array-bracket-spacing': ['error', 'never'],
|
|
19
|
-
'jsonc/comma-dangle': ['error', 'never'],
|
|
20
|
-
'jsonc/comma-style': ['error', 'last'],
|
|
21
|
-
'jsonc/indent': ['error', 2],
|
|
22
|
-
'jsonc/key-spacing': [
|
|
23
|
-
'error',
|
|
24
|
-
{
|
|
25
|
-
beforeColon: false,
|
|
26
|
-
afterColon: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'jsonc/no-octal-escape': 'error',
|
|
30
|
-
'jsonc/object-curly-newline': [
|
|
31
|
-
'error',
|
|
32
|
-
{
|
|
33
|
-
multiline: true,
|
|
34
|
-
consistent: true,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
'jsonc/object-curly-spacing': ['error', 'always'],
|
|
38
|
-
'jsonc/object-property-newline': [
|
|
39
|
-
'error',
|
|
40
|
-
{
|
|
41
|
-
allowMultiplePropertiesPerLine: true,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
49
|
-
export const pkgOrder = [
|
|
50
|
-
{
|
|
51
|
-
files: ['**/package.json'],
|
|
52
|
-
rules: {
|
|
53
|
-
'jsonc/sort-keys': [
|
|
54
|
-
'error',
|
|
55
|
-
{
|
|
56
|
-
pathPattern: '^$',
|
|
57
|
-
order: [
|
|
58
|
-
'name',
|
|
59
|
-
'type',
|
|
60
|
-
'version',
|
|
61
|
-
'private',
|
|
62
|
-
'packageManager',
|
|
63
|
-
'publisher',
|
|
64
|
-
'displayName',
|
|
65
|
-
'description',
|
|
66
|
-
'keywords',
|
|
67
|
-
'license',
|
|
68
|
-
'author',
|
|
69
|
-
'homepage',
|
|
70
|
-
'repository',
|
|
71
|
-
'funding',
|
|
72
|
-
'main',
|
|
73
|
-
'module',
|
|
74
|
-
'types',
|
|
75
|
-
'unpkg',
|
|
76
|
-
'jsdelivr',
|
|
77
|
-
'exports',
|
|
78
|
-
'files',
|
|
79
|
-
'bin',
|
|
80
|
-
'icon',
|
|
81
|
-
'sideEffects',
|
|
82
|
-
'scripts',
|
|
83
|
-
'peerDependencies',
|
|
84
|
-
'peerDependenciesMeta',
|
|
85
|
-
'dependencies',
|
|
86
|
-
'optionalDependencies',
|
|
87
|
-
'devDependencies',
|
|
88
|
-
'activationEvents',
|
|
89
|
-
'contributes',
|
|
90
|
-
'categories',
|
|
91
|
-
'engines',
|
|
92
|
-
'pnpm',
|
|
93
|
-
'husky',
|
|
94
|
-
'prettier',
|
|
95
|
-
'nano-staged',
|
|
96
|
-
'lint-staged',
|
|
97
|
-
'eslintConfig',
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
|
|
102
|
-
order: { type: 'asc' },
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
pathPattern: '^exports.*$',
|
|
106
|
-
order: ['types', 'require', 'import'],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
pathPattern: '^scripts$',
|
|
110
|
-
order: { type: 'asc' },
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
]
|
package/lib/markdown.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import markdownPlugin from 'eslint-plugin-markdown'
|
|
2
|
-
import { GLOB_EXCLUDE, GLOB_MARKDOWN } from './shared.js'
|
|
3
|
-
|
|
4
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
5
|
-
export const markdown = [
|
|
6
|
-
{
|
|
7
|
-
files: [GLOB_MARKDOWN],
|
|
8
|
-
ignores: GLOB_EXCLUDE,
|
|
9
|
-
plugins: {
|
|
10
|
-
markdown: markdownPlugin,
|
|
11
|
-
},
|
|
12
|
-
processor: 'markdown/markdown',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
files: ['**/*.md/*'],
|
|
16
|
-
languageOptions: {
|
|
17
|
-
parserOptions: {
|
|
18
|
-
ecmaFeatures: {
|
|
19
|
-
impliedStrict: true,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
rules: {
|
|
24
|
-
...markdownPlugin.configs.recommended.overrides[1].rules,
|
|
25
|
-
'no-undef': 'off',
|
|
26
|
-
'no-alert': 'off',
|
|
27
|
-
'no-console': 'off',
|
|
28
|
-
'no-unused-vars': 'off',
|
|
29
|
-
'no-unused-expressions': 'off',
|
|
30
|
-
'no-restricted-imports': 'off',
|
|
31
|
-
|
|
32
|
-
'import/no-unresolved': 'off',
|
|
33
|
-
|
|
34
|
-
'@typescript-eslint/comma-dangle': 'off',
|
|
35
|
-
'@typescript-eslint/no-redeclare': 'off',
|
|
36
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
37
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
38
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
39
|
-
|
|
40
|
-
'unused-imports/no-unused-imports': 'off',
|
|
41
|
-
'unused-imports/no-unused-vars': 'off',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
]
|
package/lib/presets.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import jsConfig from '@eslint/js'
|
|
2
|
-
import { ts } from './ts.js'
|
|
3
|
-
import { yml } from './yml.js'
|
|
4
|
-
import { vue } from './vue.js'
|
|
5
|
-
import { markdown } from './markdown.js'
|
|
6
|
-
import { jsonc, pkgOrder } from './jsonc.js'
|
|
7
|
-
import { imports, js, jsx, unicorn } from './js.js'
|
|
8
|
-
import { eslintComments } from './eslint-comments.js'
|
|
9
|
-
|
|
10
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
11
|
-
export const presetBasic = [
|
|
12
|
-
jsConfig.configs.recommended,
|
|
13
|
-
...js,
|
|
14
|
-
...jsx,
|
|
15
|
-
...ts,
|
|
16
|
-
...vue,
|
|
17
|
-
...yml,
|
|
18
|
-
...imports,
|
|
19
|
-
...unicorn,
|
|
20
|
-
...jsonc,
|
|
21
|
-
...pkgOrder,
|
|
22
|
-
...markdown,
|
|
23
|
-
...eslintComments,
|
|
24
|
-
]
|
package/lib/prettier.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import prettierPlugin from 'eslint-plugin-prettier'
|
|
2
|
-
import prettierConfig from 'eslint-config-prettier'
|
|
3
|
-
|
|
4
|
-
const prettierConflictRules = { ...prettierConfig.rules }
|
|
5
|
-
delete prettierConflictRules['vue/html-self-closing']
|
|
6
|
-
|
|
7
|
-
/** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
|
|
8
|
-
export const prettier = [
|
|
9
|
-
{
|
|
10
|
-
plugins: {
|
|
11
|
-
prettier: prettierPlugin,
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
...prettierConflictRules,
|
|
15
|
-
...prettierPlugin.configs.recommended.rules,
|
|
16
|
-
'prettier/prettier': 'warn',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
]
|
package/lib/shared.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
export const GLOB_SRC = '**/*.?([mt])[jt]s?(x)'
|
|
4
|
-
|
|
5
|
-
export const GLOB_JS = '**/*.?([mt])js'
|
|
6
|
-
export const GLOB_JSX = '**/*.?([mt])jsx'
|
|
7
|
-
|
|
8
|
-
export const GLOB_TS = '**/*.?([mt])ts'
|
|
9
|
-
export const GLOB_TSX = '**/*.?([mt])tsx'
|
|
10
|
-
|
|
11
|
-
export const GLOB_STYLE = '**/*.{c,le,sc}ss'
|
|
12
|
-
export const GLOB_CSS = '**/*.css'
|
|
13
|
-
export const GLOB_LESS = '**/*.less'
|
|
14
|
-
export const GLOB_SCSS = '**/*.scss'
|
|
15
|
-
|
|
16
|
-
export const GLOB_JSON = '**/*.json'
|
|
17
|
-
export const GLOB_JSON5 = '**/*.json5'
|
|
18
|
-
export const GLOB_JSONC = '**/*.jsonc'
|
|
19
|
-
|
|
20
|
-
export const GLOB_VUE = '**/*.vue'
|
|
21
|
-
export const GLOB_ASTRO = '**/*.astro'
|
|
22
|
-
|
|
23
|
-
export const GLOB_MARKDOWN = '**/*.md'
|
|
24
|
-
export const GLOB_YAML = '**/*.y?(a)ml'
|
|
25
|
-
export const GLOB_HTML = '**/*.htm?(l)'
|
|
26
|
-
|
|
27
|
-
export const GLOB_ALL_SRC = /** @type {const} */ ([
|
|
28
|
-
GLOB_SRC,
|
|
29
|
-
GLOB_STYLE,
|
|
30
|
-
GLOB_JSON,
|
|
31
|
-
GLOB_JSON5,
|
|
32
|
-
GLOB_MARKDOWN,
|
|
33
|
-
GLOB_VUE,
|
|
34
|
-
GLOB_YAML,
|
|
35
|
-
GLOB_HTML,
|
|
36
|
-
])
|
|
37
|
-
|
|
38
|
-
export const GLOB_NODE_MODULES = /** @type {const} */ ('**/node_modules/**')
|
|
39
|
-
export const GLOB_DIST = /** @type {const} */ ('**/dist/**')
|
|
40
|
-
export const GLOB_LOCKFILE = /** @type {const} */ ([
|
|
41
|
-
'**/package-lock.json',
|
|
42
|
-
'**/yarn.lock',
|
|
43
|
-
'**/pnpm-lock.yaml',
|
|
44
|
-
])
|
|
45
|
-
export const GLOB_EXCLUDE = /** @type {const} */ ([
|
|
46
|
-
GLOB_NODE_MODULES,
|
|
47
|
-
GLOB_DIST,
|
|
48
|
-
...GLOB_LOCKFILE,
|
|
49
|
-
'**/CHANGELOG*.md',
|
|
50
|
-
'**/*.min.*',
|
|
51
|
-
'**/LICENSE*',
|
|
52
|
-
'**/output',
|
|
53
|
-
'**/coverage',
|
|
54
|
-
'**/temp',
|
|
55
|
-
'**/fixtures',
|
|
56
|
-
'**/__snapshots__',
|
|
57
|
-
'**/auto-import.d.ts',
|
|
58
|
-
'**/components.d.ts',
|
|
59
|
-
'**/.npmrc',
|
|
60
|
-
'**/.yarnrc',
|
|
61
|
-
])
|
package/lib/ts.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import tsParser from '@typescript-eslint/parser'
|
|
2
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
3
|
-
import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from './shared.js'
|
|
4
|
-
|
|
5
|
-
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
6
|
-
export const ts = [
|
|
7
|
-
{
|
|
8
|
-
files: [GLOB_TS, GLOB_TSX],
|
|
9
|
-
ignores: GLOB_EXCLUDE,
|
|
10
|
-
languageOptions: {
|
|
11
|
-
parser: tsParser,
|
|
12
|
-
parserOptions: {
|
|
13
|
-
sourceType: 'module',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
plugins: {
|
|
17
|
-
'@typescript-eslint': tsPlugin,
|
|
18
|
-
},
|
|
19
|
-
rules: {
|
|
20
|
-
...tsPlugin.configs['eslint-recommended'].overrides[0].rules,
|
|
21
|
-
...tsPlugin.configs['recommended'].rules,
|
|
22
|
-
|
|
23
|
-
'@typescript-eslint/no-unused-vars': 'error',
|
|
24
|
-
'@typescript-eslint/no-redeclare': 'error',
|
|
25
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
26
|
-
'error',
|
|
27
|
-
{
|
|
28
|
-
prefer: 'type-imports',
|
|
29
|
-
fixStyle: 'separate-type-imports',
|
|
30
|
-
disallowTypeAnnotations: false,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
'@typescript-eslint/prefer-as-const': 'warn',
|
|
34
|
-
|
|
35
|
-
'@typescript-eslint/ban-types': 'off',
|
|
36
|
-
'@typescript-eslint/camelcase': 'off',
|
|
37
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
38
|
-
'@typescript-eslint/ban-ts-ignore': 'off',
|
|
39
|
-
'@typescript-eslint/ban-ts-comment': 'off',
|
|
40
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
41
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
42
|
-
'@typescript-eslint/naming-convention': 'off',
|
|
43
|
-
'@typescript-eslint/no-empty-interface': 'off',
|
|
44
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
45
|
-
'@typescript-eslint/triple-slash-reference': 'off',
|
|
46
|
-
'@typescript-eslint/no-parameter-properties': 'off',
|
|
47
|
-
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
48
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
49
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
50
|
-
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
files: ['**/*.d.ts'],
|
|
56
|
-
ignores: GLOB_EXCLUDE,
|
|
57
|
-
rules: {
|
|
58
|
-
'import/no-duplicates': 'off',
|
|
59
|
-
'import/newline-after-import': 'off',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
files: ['**/*.{spec,test}.ts?(x)'],
|
|
65
|
-
rules: {
|
|
66
|
-
'no-unused-expressions': 'off',
|
|
67
|
-
'max-lines-per-function': 'off',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
]
|