@ocavue/eslint-config 2.16.0 → 2.18.0
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 +32 -22
- package/dist/antfu.d.ts +2 -0
- package/dist/antfu.js +15 -0
- package/dist/basic.d.ts +2 -0
- package/dist/basic.js +20 -0
- package/dist/ignores.d.ts +2 -0
- package/dist/ignores.js +8 -0
- package/dist/imports.d.ts +2 -0
- package/dist/imports.js +49 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +27 -0
- package/dist/markdown.d.ts +2 -0
- package/dist/markdown.js +41 -0
- package/dist/no-only-tests.d.ts +2 -0
- package/dist/no-only-tests.js +14 -0
- package/dist/options.d.ts +21 -0
- package/dist/options.js +7 -0
- package/dist/package-json.d.ts +5 -0
- package/dist/package-json.js +70 -0
- package/dist/{src/prettier.d.ts → prettier.d.ts} +2 -2
- package/{src → dist}/prettier.js +9 -13
- package/dist/react.d.ts +2 -0
- package/dist/react.js +34 -0
- package/dist/shared.d.ts +23 -0
- package/dist/shared.js +49 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1 -0
- package/dist/typescript.d.ts +4 -0
- package/dist/typescript.js +112 -0
- package/dist/unicorn.d.ts +2 -0
- package/dist/unicorn.js +71 -0
- package/dist/vue.d.ts +2 -0
- package/dist/vue.js +33 -0
- package/package.json +20 -24
- package/dist/eslint.config.d.ts +0 -3
- package/dist/eslint.config.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/src/antfu.d.ts +0 -2
- package/dist/src/antfu.d.ts.map +0 -1
- package/dist/src/basic.d.ts +0 -2
- package/dist/src/basic.d.ts.map +0 -1
- package/dist/src/ignores.d.ts +0 -2
- package/dist/src/ignores.d.ts.map +0 -1
- package/dist/src/imports.d.ts +0 -2
- package/dist/src/imports.d.ts.map +0 -1
- package/dist/src/markdown.d.ts +0 -2
- package/dist/src/markdown.d.ts.map +0 -1
- package/dist/src/no-only-tests.d.ts +0 -2
- package/dist/src/no-only-tests.d.ts.map +0 -1
- package/dist/src/package-json.d.ts +0 -5
- package/dist/src/package-json.d.ts.map +0 -1
- package/dist/src/prettier.d.ts.map +0 -1
- package/dist/src/react.d.ts +0 -2
- package/dist/src/react.d.ts.map +0 -1
- package/dist/src/shared.d.ts +0 -24
- package/dist/src/shared.d.ts.map +0 -1
- package/dist/src/typescript.d.ts +0 -4
- package/dist/src/typescript.d.ts.map +0 -1
- package/dist/src/unicorn.d.ts +0 -2
- package/dist/src/unicorn.d.ts.map +0 -1
- package/dist/src/vue.d.ts +0 -2
- package/dist/src/vue.d.ts.map +0 -1
- package/index.js +0 -6
- package/src/antfu.js +0 -19
- package/src/basic.js +0 -26
- package/src/ignores.js +0 -10
- package/src/imports.js +0 -55
- package/src/markdown.js +0 -63
- package/src/no-only-tests.js +0 -20
- package/src/package-json.js +0 -78
- package/src/react.js +0 -45
- package/src/shared.js +0 -61
- package/src/typescript.js +0 -128
- package/src/unicorn.js +0 -75
- package/src/vue.js +0 -46
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
import { GLOB_JS, GLOB_JSX, GLOB_TEST, GLOB_TS, GLOB_TSX } from './shared.js';
|
|
4
|
+
export { tseslint };
|
|
5
|
+
export function typescript() {
|
|
6
|
+
const rules = [...tseslint.configs.recommended, ...tseslint.configs.stylistic]
|
|
7
|
+
.map((config) => config.rules || {})
|
|
8
|
+
.reduce((acc, cur) => ({ ...acc, ...cur }), {});
|
|
9
|
+
const config = [
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
{
|
|
12
|
+
name: 'typescript',
|
|
13
|
+
files: [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parser: tseslint.parser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
projectService: true,
|
|
18
|
+
sourceType: 'module',
|
|
19
|
+
ecmaVersion: 'latest',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
plugins: {
|
|
23
|
+
'@typescript-eslint': tseslint.plugin,
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
...rules,
|
|
27
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
28
|
+
'@typescript-eslint/prefer-optional-chain': 'off',
|
|
29
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
30
|
+
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
31
|
+
'@typescript-eslint/array-type': 'off',
|
|
32
|
+
'@typescript-eslint/dot-notation': 'off',
|
|
33
|
+
'@typescript-eslint/triple-slash-reference': 'off',
|
|
34
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
35
|
+
'warn',
|
|
36
|
+
{
|
|
37
|
+
// Allow type imports in type annotations (e.g. `type T = import('Foo').Foo`)
|
|
38
|
+
disallowTypeAnnotations: false,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
'@typescript-eslint/no-import-type-side-effects': 'warn',
|
|
42
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
|
|
43
|
+
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'warn',
|
|
44
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
45
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
46
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
47
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
48
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
49
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
50
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
51
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
52
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
53
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
54
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
55
|
+
'@typescript-eslint/no-unused-vars': [
|
|
56
|
+
'error',
|
|
57
|
+
{
|
|
58
|
+
argsIgnorePattern: '^_',
|
|
59
|
+
varsIgnorePattern: '^_',
|
|
60
|
+
caughtErrorsIgnorePattern: '^_',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
'@typescript-eslint/no-extra-semi': 'off',
|
|
64
|
+
'@typescript-eslint/prefer-function-type': 'warn',
|
|
65
|
+
'@typescript-eslint/no-misused-promises': [
|
|
66
|
+
'error',
|
|
67
|
+
{ checksVoidReturn: false },
|
|
68
|
+
],
|
|
69
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
70
|
+
'@typescript-eslint/unbound-method': 'error',
|
|
71
|
+
// `type T1 = T0` and `interface T2 extends T0 {}` have the same meaning
|
|
72
|
+
// but different behavior in TypeScript type checking. `T1` and `T0` are
|
|
73
|
+
// the same type, while `T2` is different than `T0`. We allow `interface
|
|
74
|
+
// T2 extends T0 {}` explicitly.
|
|
75
|
+
'@typescript-eslint/no-empty-object-type': [
|
|
76
|
+
'error',
|
|
77
|
+
{
|
|
78
|
+
allowInterfaces: 'with-single-extends',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
// Turn off this rule because it's incompatible with the `--isolatedDeclarations` compiler option.
|
|
82
|
+
'@typescript-eslint/no-inferrable-types': 'off',
|
|
83
|
+
// TODO: We should set the rule below to error in the future
|
|
84
|
+
'@typescript-eslint/require-await': 'warn',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'typescript-js',
|
|
89
|
+
files: [GLOB_JS, GLOB_JSX],
|
|
90
|
+
rules: {
|
|
91
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
92
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'typescript-test',
|
|
97
|
+
files: [GLOB_TEST],
|
|
98
|
+
rules: {
|
|
99
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
100
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
101
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
102
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
103
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
104
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
105
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
// @ts-expect-error: unmatched type
|
|
110
|
+
const configTyped = config;
|
|
111
|
+
return configTyped;
|
|
112
|
+
}
|
package/dist/unicorn.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import plugin from 'eslint-plugin-unicorn';
|
|
2
|
+
export function unicorn() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'unicorn',
|
|
6
|
+
plugins: {
|
|
7
|
+
unicorn: plugin,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
// Pass error message when throwing errors
|
|
11
|
+
'unicorn/error-message': 'error',
|
|
12
|
+
// Uppercase regex escapes
|
|
13
|
+
'unicorn/escape-case': 'error',
|
|
14
|
+
// Array.isArray instead of instanceof etc
|
|
15
|
+
'unicorn/no-instanceof-builtins': 'error',
|
|
16
|
+
// Prevent deprecated `new Buffer()`
|
|
17
|
+
'unicorn/no-new-buffer': 'error',
|
|
18
|
+
// Keep regex literals safe!
|
|
19
|
+
'unicorn/no-unsafe-regex': 'off',
|
|
20
|
+
// Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
|
|
21
|
+
'unicorn/number-literal-case': 'error',
|
|
22
|
+
// includes over indexOf when checking for existence
|
|
23
|
+
'unicorn/prefer-includes': 'error',
|
|
24
|
+
// String methods startsWith/endsWith instead of more complicated stuff
|
|
25
|
+
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
26
|
+
// Enforce throwing type error when throwing error while checking typeof
|
|
27
|
+
'unicorn/prefer-type-error': 'error',
|
|
28
|
+
// Use new when throwing error
|
|
29
|
+
'unicorn/throw-new-error': 'error',
|
|
30
|
+
// Prefer using the node: protocol
|
|
31
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
32
|
+
// Enforce explicitly comparing the length or size property of a value
|
|
33
|
+
'unicorn/explicit-length-check': 'error',
|
|
34
|
+
// Prefer `.flatMap(…)` over `.map(…).flat()`
|
|
35
|
+
'unicorn/prefer-array-index-of': 'error',
|
|
36
|
+
// Improve regexes
|
|
37
|
+
'unicorn/better-regex': 'error',
|
|
38
|
+
// Enforce combining multiple `Array#push()` into one call.
|
|
39
|
+
'unicorn/prefer-single-call': 'warn',
|
|
40
|
+
// Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
41
|
+
'unicorn/no-for-loop': 'error',
|
|
42
|
+
// Disallow eslint-disable comments without specific rule names
|
|
43
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
44
|
+
// Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
45
|
+
'unicorn/prefer-add-event-listener': 'error',
|
|
46
|
+
// Prefer `.find(…)` and `.findLast(…)` over the first or last element from
|
|
47
|
+
'unicorn/prefer-array-find': 'error',
|
|
48
|
+
// Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
49
|
+
'unicorn/prefer-array-flat-map': 'error',
|
|
50
|
+
// Prefer `.some(…)` over `.filter(…).length` check
|
|
51
|
+
'unicorn/prefer-array-some': 'error',
|
|
52
|
+
// Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`
|
|
53
|
+
'unicorn/prefer-keyboard-event-key': 'error',
|
|
54
|
+
// Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
55
|
+
'unicorn/prefer-math-trunc': 'error',
|
|
56
|
+
// Prefer negative index over `.length - index` when possible
|
|
57
|
+
'unicorn/prefer-negative-index': 'error',
|
|
58
|
+
// Prefer `Number` static properties over global ones.
|
|
59
|
+
'unicorn/prefer-number-properties': 'warn',
|
|
60
|
+
// Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`
|
|
61
|
+
'unicorn/prefer-regexp-test': 'warn',
|
|
62
|
+
// Prefer using `structuredClone` to create a deep clone
|
|
63
|
+
'unicorn/prefer-structured-clone': 'warn',
|
|
64
|
+
// Prefer using the `String.raw` tag to avoid escaping `\`
|
|
65
|
+
'unicorn/prefer-string-raw': 'warn',
|
|
66
|
+
// Prefer `import.meta.dirname` over `path.dirname(fileURLToPath(import.meta.url))`
|
|
67
|
+
'unicorn/prefer-import-meta-properties': 'warn',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
}
|
package/dist/vue.d.ts
ADDED
package/dist/vue.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import prettierConfig from 'eslint-config-prettier';
|
|
2
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import tseslint from 'typescript-eslint';
|
|
5
|
+
import { GLOB_VUE } from './shared.js';
|
|
6
|
+
export function vue() {
|
|
7
|
+
return [
|
|
8
|
+
...vuePlugin.configs['flat/recommended'],
|
|
9
|
+
{
|
|
10
|
+
name: 'vue:language-options',
|
|
11
|
+
files: [GLOB_VUE],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 'latest',
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
globals: globals.browser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
parser: tseslint.parser,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'vue:rules-override',
|
|
23
|
+
rules: {
|
|
24
|
+
...Object.fromEntries(Object.entries(prettierConfig.rules)
|
|
25
|
+
.filter(([key]) => key.startsWith('vue/'))
|
|
26
|
+
.map(([key, value]) => [key, value])),
|
|
27
|
+
'vue/multi-word-component-names': 'off',
|
|
28
|
+
'vue/one-component-per-file': 'off',
|
|
29
|
+
'vue/require-prop-types': 'off',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocavue/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@9.15.9",
|
|
4
|
+
"version": "2.18.0",
|
|
6
5
|
"description": "",
|
|
7
6
|
"author": "ocavue <ocavue@gmail.com>",
|
|
8
7
|
"license": "MIT",
|
|
@@ -22,46 +21,37 @@
|
|
|
22
21
|
"vue"
|
|
23
22
|
],
|
|
24
23
|
"sideEffects": false,
|
|
25
|
-
"main": "./index.js",
|
|
26
|
-
"module": "./index.js",
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.js",
|
|
27
26
|
"types": "./dist/index.d.ts",
|
|
28
27
|
"files": [
|
|
29
|
-
"index.js",
|
|
30
|
-
"src",
|
|
31
28
|
"dist"
|
|
32
29
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "tsc",
|
|
35
|
-
"check": "prettier --check .",
|
|
36
|
-
"fix": "eslint --fix . && prettier --write .",
|
|
37
|
-
"lint": "eslint .",
|
|
38
|
-
"prepublishOnly": "nr build"
|
|
39
|
-
},
|
|
40
30
|
"dependencies": {
|
|
41
31
|
"@eslint/js": "^9.26.0",
|
|
42
32
|
"@eslint/markdown": "^6.4.0",
|
|
43
33
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
44
|
-
"eslint-config-prettier": "^10.1.
|
|
45
|
-
"eslint-import-resolver-typescript": "^4.3.
|
|
34
|
+
"eslint-config-prettier": "^10.1.5",
|
|
35
|
+
"eslint-import-resolver-typescript": "^4.3.5",
|
|
46
36
|
"eslint-plugin-antfu": "^3.1.1",
|
|
47
|
-
"eslint-plugin-import-x": "^4.
|
|
37
|
+
"eslint-plugin-import-x": "^4.12.2",
|
|
48
38
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
49
39
|
"eslint-plugin-package-json": "^0.31.0",
|
|
50
40
|
"eslint-plugin-react": "^7.37.5",
|
|
51
41
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
52
|
-
"eslint-plugin-unicorn": "^
|
|
42
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
53
43
|
"eslint-plugin-vue": "^10.1.0",
|
|
54
|
-
"globals": "^16.
|
|
55
|
-
"typescript-eslint": "^8.
|
|
44
|
+
"globals": "^16.1.0",
|
|
45
|
+
"typescript-eslint": "^8.32.1",
|
|
56
46
|
"vue-eslint-parser": "^10.1.3"
|
|
57
47
|
},
|
|
58
48
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@types/eslint-config-prettier": "^6.11.3",
|
|
49
|
+
"@ocavue/tsconfig": "^0.3.7",
|
|
61
50
|
"@types/node": "^20.17.9",
|
|
62
|
-
"@typescript-eslint/utils": "^8.
|
|
51
|
+
"@typescript-eslint/utils": "^8.32.1",
|
|
63
52
|
"eslint": "^9.26.0",
|
|
64
|
-
"
|
|
53
|
+
"jiti": "^2.4.2",
|
|
54
|
+
"pkg-pr-new": "^0.0.50",
|
|
65
55
|
"prettier": "^3.5.3",
|
|
66
56
|
"typescript": "^5.8.3"
|
|
67
57
|
},
|
|
@@ -69,5 +59,11 @@
|
|
|
69
59
|
"extends": [
|
|
70
60
|
"github>ocavue/config-renovate"
|
|
71
61
|
]
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsc -b",
|
|
65
|
+
"check": "prettier --check .",
|
|
66
|
+
"fix": "eslint --fix . && prettier --write .",
|
|
67
|
+
"lint": "eslint ."
|
|
72
68
|
}
|
|
73
|
-
}
|
|
69
|
+
}
|
package/dist/eslint.config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":""}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":""}
|
package/dist/src/antfu.d.ts
DELETED
package/dist/src/antfu.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"antfu.d.ts","sourceRoot":"","sources":["../../src/antfu.js"],"names":[],"mappings":"AAEA,+FAgBC"}
|
package/dist/src/basic.d.ts
DELETED
package/dist/src/basic.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/basic.js"],"names":[],"mappings":"AAWA,+FAcC"}
|
package/dist/src/ignores.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ignores.d.ts","sourceRoot":"","sources":["../../src/ignores.js"],"names":[],"mappings":"AAIA,iGAKC"}
|
package/dist/src/imports.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/imports.js"],"names":[],"mappings":"AAIA,iGAkDC"}
|
package/dist/src/markdown.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown.js"],"names":[],"mappings":"AAMA,kGAwDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-only-tests.d.ts","sourceRoot":"","sources":["../../src/no-only-tests.js"],"names":[],"mappings":"AAIA,qGAeC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/package-json.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,qGAsEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/prettier.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,kGAYC"}
|
package/dist/src/react.d.ts
DELETED
package/dist/src/react.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.js"],"names":[],"mappings":"AAWA,+FAiCC"}
|
package/dist/src/shared.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const GLOB_SRC_EXT: "?([cm])[jt]s?(x)";
|
|
2
|
-
export const GLOB_SRC: "**/*.?([cm])[jt]s?(x)";
|
|
3
|
-
export const GLOB_JS: "**/*.?([cm])js";
|
|
4
|
-
export const GLOB_JSX: "**/*.?([cm])jsx";
|
|
5
|
-
export const GLOB_TS: "**/*.?([cm])ts";
|
|
6
|
-
export const GLOB_TSX: "**/*.?([cm])tsx";
|
|
7
|
-
export const GLOB_TEST: "**/*.(spec|test).?([cm])[jt]s?(x)";
|
|
8
|
-
export const GLOB_STYLE: "**/*.{c,le,sc}ss";
|
|
9
|
-
export const GLOB_CSS: "**/*.css";
|
|
10
|
-
export const GLOB_LESS: "**/*.less";
|
|
11
|
-
export const GLOB_SCSS: "**/*.scss";
|
|
12
|
-
export const GLOB_JSON: "**/*.json";
|
|
13
|
-
export const GLOB_JSON5: "**/*.json5";
|
|
14
|
-
export const GLOB_JSONC: "**/*.jsonc";
|
|
15
|
-
export const GLOB_MARKDOWN: "**/*.md";
|
|
16
|
-
export const GLOB_VUE: "**/*.vue";
|
|
17
|
-
export const GLOB_YAML: "**/*.y?(a)ml";
|
|
18
|
-
export const GLOB_HTML: "**/*.htm?(l)";
|
|
19
|
-
export const GLOB_ALL_SRC: readonly ["**/*.?([cm])[jt]s?(x)", "**/*.{c,le,sc}ss", "**/*.json", "**/*.json5", "**/*.md", "**/*.vue", "**/*.y?(a)ml", "**/*.htm?(l)"];
|
|
20
|
-
export const GLOB_NODE_MODULES: "**/node_modules";
|
|
21
|
-
export const GLOB_LOCKFILE: readonly ["**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml"];
|
|
22
|
-
export const GLOB_EXCLUDE: readonly ["**/node_modules", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/fixtures", "**/.changeset", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__", "**/.tsup"];
|
|
23
|
-
export const EXTENSIONS: string[];
|
|
24
|
-
//# sourceMappingURL=shared.d.ts.map
|
package/dist/src/shared.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/shared.js"],"names":[],"mappings":"AAEA,2BAA4B,kBAAkB,CAAA;AAC9C,uBAAwB,uBAAuB,CAAA;AAE/C,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,wBAAyB,mCAAmC,CAAA;AAE5D,yBAA0B,kBAAkB,CAAA;AAC5C,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,WAAW,CAAA;AACpC,wBAAyB,WAAW,CAAA;AAEpC,wBAAyB,WAAW,CAAA;AACpC,yBAA0B,YAAY,CAAA;AACtC,yBAA0B,YAAY,CAAA;AAEtC,4BAA6B,SAAS,CAAA;AACtC,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,cAAc,CAAA;AACvC,wBAAyB,cAAc,CAAA;AAEvC,oKASE;AAEF,gCAAuD,iBAAiB,CAAC;AACzE,mGAIE;AACF,sOAWE;AAEF,kCAGsC"}
|
package/dist/src/typescript.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AASA,oGAsHC;;qBA5HoB,mBAAmB"}
|
package/dist/src/unicorn.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/unicorn.js"],"names":[],"mappings":"AAIA,iGAsEC"}
|
package/dist/src/vue.d.ts
DELETED
package/dist/src/vue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/vue.js"],"names":[],"mappings":"AAYA,6FAiCC"}
|
package/index.js
DELETED
package/src/antfu.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import antfuPlugin from 'eslint-plugin-antfu'
|
|
2
|
-
|
|
3
|
-
export function antfu() {
|
|
4
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
5
|
-
const config = [
|
|
6
|
-
{
|
|
7
|
-
name: 'antfu',
|
|
8
|
-
plugins: {
|
|
9
|
-
antfu: antfuPlugin,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
'antfu/import-dedupe': 'error',
|
|
13
|
-
'antfu/top-level-function': 'error',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
return config
|
|
19
|
-
}
|
package/src/basic.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import { antfu } from './antfu.js'
|
|
4
|
-
import { ignores } from './ignores.js'
|
|
5
|
-
import { imports } from './imports.js'
|
|
6
|
-
import { noOnlyTests } from './no-only-tests.js'
|
|
7
|
-
import { packageJson } from './package-json.js'
|
|
8
|
-
import { prettier } from './prettier.js'
|
|
9
|
-
import { typescript } from './typescript.js'
|
|
10
|
-
import { unicorn } from './unicorn.js'
|
|
11
|
-
|
|
12
|
-
export function basic() {
|
|
13
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
14
|
-
const config = [
|
|
15
|
-
...ignores(),
|
|
16
|
-
...typescript(),
|
|
17
|
-
...imports(),
|
|
18
|
-
...packageJson(),
|
|
19
|
-
...unicorn(),
|
|
20
|
-
...antfu(),
|
|
21
|
-
...noOnlyTests(),
|
|
22
|
-
...prettier(),
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
return config
|
|
26
|
-
}
|
package/src/ignores.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import gitignore from 'eslint-config-flat-gitignore'
|
|
2
|
-
|
|
3
|
-
import { GLOB_EXCLUDE } from './shared.js'
|
|
4
|
-
|
|
5
|
-
export function ignores() {
|
|
6
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
7
|
-
const config = [{ ignores: [...GLOB_EXCLUDE] }, gitignore()]
|
|
8
|
-
|
|
9
|
-
return config
|
|
10
|
-
}
|
package/src/imports.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import * as importPlugin from 'eslint-plugin-import-x'
|
|
4
|
-
|
|
5
|
-
export function imports() {
|
|
6
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
7
|
-
const config = [
|
|
8
|
-
{
|
|
9
|
-
name: 'import',
|
|
10
|
-
plugins: {
|
|
11
|
-
// @ts-expect-error incorrect type
|
|
12
|
-
import: importPlugin,
|
|
13
|
-
},
|
|
14
|
-
settings: {
|
|
15
|
-
'import-x/resolver': {
|
|
16
|
-
// You will also need to install and configure the TypeScript resolver
|
|
17
|
-
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
|
|
18
|
-
typescript: true,
|
|
19
|
-
node: true,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
// External modules must be declared in the package.json. Only enforced in CI.
|
|
24
|
-
'import/no-extraneous-dependencies': process.env.CI ? 'error' : 'off',
|
|
25
|
-
'import/first': 'warn',
|
|
26
|
-
'import/no-mutable-exports': 'warn',
|
|
27
|
-
'import/no-useless-path-segments': 'warn',
|
|
28
|
-
'import/newline-after-import': 'warn',
|
|
29
|
-
// Disable `no-duplicates` because of the following bug
|
|
30
|
-
// https://github.com/un-ts/eslint-plugin-import-x/issues/167
|
|
31
|
-
// 'import/no-duplicates': [
|
|
32
|
-
// 'warn',
|
|
33
|
-
// { 'prefer-inline': true },
|
|
34
|
-
// ],
|
|
35
|
-
'import/order': [
|
|
36
|
-
'warn',
|
|
37
|
-
{
|
|
38
|
-
'newlines-between': 'always',
|
|
39
|
-
alphabetize: { order: 'asc' },
|
|
40
|
-
groups: [
|
|
41
|
-
'builtin',
|
|
42
|
-
'external',
|
|
43
|
-
'internal',
|
|
44
|
-
'parent',
|
|
45
|
-
'sibling',
|
|
46
|
-
'index',
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
return config
|
|
55
|
-
}
|
package/src/markdown.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import markdownPlugin from '@eslint/markdown'
|
|
4
|
-
|
|
5
|
-
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from './shared.js'
|
|
6
|
-
|
|
7
|
-
export function markdown() {
|
|
8
|
-
const recommended = markdownPlugin.configs?.processor
|
|
9
|
-
|
|
10
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
11
|
-
const recommendedConfig = Array.isArray(recommended)
|
|
12
|
-
? recommended
|
|
13
|
-
: (() => {
|
|
14
|
-
throw new Error(
|
|
15
|
-
'[@ocavue/eslint-config] markdown recommended is not an array',
|
|
16
|
-
)
|
|
17
|
-
})()
|
|
18
|
-
|
|
19
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
20
|
-
const config = [
|
|
21
|
-
...recommendedConfig,
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
25
|
-
languageOptions: {
|
|
26
|
-
parserOptions: {
|
|
27
|
-
projectService: null,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
rules: {
|
|
31
|
-
// Disable type-aware TypeScript rules, because the code blocks are not
|
|
32
|
-
// part of a compilable `tsconfig.json` project.
|
|
33
|
-
'@typescript-eslint/no-redeclare': 'off',
|
|
34
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
35
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
36
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
37
|
-
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
38
|
-
'@typescript-eslint/no-unsafe-call': 'off',
|
|
39
|
-
'@typescript-eslint/no-unsafe-return': 'off',
|
|
40
|
-
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
41
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
42
|
-
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
43
|
-
'@typescript-eslint/no-floating-promises': 'off',
|
|
44
|
-
'@typescript-eslint/no-misused-promises': 'off',
|
|
45
|
-
'@typescript-eslint/await-thenable': 'off',
|
|
46
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
47
|
-
'@typescript-eslint/require-await': 'off',
|
|
48
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
|
|
49
|
-
|
|
50
|
-
// Disable some import rules because they are not working well with
|
|
51
|
-
// twoslash ---cut--- imports.
|
|
52
|
-
'import/first': 'off',
|
|
53
|
-
'import/order': 'off',
|
|
54
|
-
|
|
55
|
-
'no-alert': 'off',
|
|
56
|
-
'no-console': 'off',
|
|
57
|
-
'no-restricted-imports': 'off',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
return config
|
|
63
|
-
}
|