@ocavue/eslint-config 1.4.1 → 1.5.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/dist/src/markdown.d.ts.map +1 -1
- package/dist/src/typescript.d.ts +2 -3
- package/dist/src/typescript.d.ts.map +1 -1
- package/dist/src/unicorn.d.ts.map +1 -1
- package/package.json +16 -15
- package/src/markdown.js +5 -42
- package/src/typescript.js +14 -10
- package/src/unicorn.js +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown.js"],"names":[],"mappings":"AAMA,8EAsBC"}
|
package/dist/src/typescript.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export function typescript(): import("eslint-define-config").FlatESLintConfig[];
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
export { tsParser, tsPlugin };
|
|
2
|
+
export { tseslint };
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
5
4
|
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AAWA,gFA4EC;;qBAlFoB,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/unicorn.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/unicorn.js"],"names":[],"mappings":"AAMA,6EAiEC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocavue/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "1.5.0",
|
|
5
|
+
"packageManager": "pnpm@8.15.6",
|
|
6
6
|
"description": "",
|
|
7
7
|
"author": "ocavue <ocavue@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -31,30 +31,31 @@
|
|
|
31
31
|
"prepublishOnly": "nr build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@types/eslint": "^
|
|
34
|
+
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
35
|
+
"@eslint-types/unicorn": "^52.0.0",
|
|
36
|
+
"@types/eslint": "^8.56.7",
|
|
35
37
|
"@types/eslint-plugin-markdown": "^2.0.2",
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
37
|
-
"@typescript-eslint/parser": "^6.16.0",
|
|
38
38
|
"eslint-config-prettier": "^9.1.0",
|
|
39
39
|
"eslint-define-config": "^2.1.0",
|
|
40
40
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
41
|
-
"eslint-plugin-antfu": "^1.
|
|
41
|
+
"eslint-plugin-antfu": "^2.1.2",
|
|
42
42
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
43
43
|
"eslint-plugin-import": "^2.29.1",
|
|
44
|
-
"eslint-plugin-jsonc": "^2.
|
|
45
|
-
"eslint-plugin-markdown": "^
|
|
44
|
+
"eslint-plugin-jsonc": "^2.15.0",
|
|
45
|
+
"eslint-plugin-markdown": "^4.0.1",
|
|
46
46
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
47
|
-
"eslint-plugin-react": "^7.
|
|
47
|
+
"eslint-plugin-react": "^7.34.1",
|
|
48
48
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
-
"eslint-plugin-unicorn": "^
|
|
50
|
-
"jsonc-eslint-parser": "^2.4.0"
|
|
49
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
50
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
51
|
+
"typescript-eslint": "^7.5.0"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@antfu/ni": "^0.21.12",
|
|
54
|
-
"@types/node": "^20.
|
|
55
|
-
"eslint": "^8.
|
|
56
|
-
"prettier": "^2.
|
|
57
|
-
"typescript": "^5.
|
|
55
|
+
"@types/node": "^20.12.5",
|
|
56
|
+
"eslint": "^8.57.0",
|
|
57
|
+
"prettier": "^3.2.5",
|
|
58
|
+
"typescript": "^5.4.4"
|
|
58
59
|
},
|
|
59
60
|
"renovate": {
|
|
60
61
|
"extends": [
|
package/src/markdown.js
CHANGED
|
@@ -1,63 +1,26 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import markdownPlugin from 'eslint-plugin-markdown'
|
|
3
|
+
import * as markdownPlugin from 'eslint-plugin-markdown'
|
|
5
4
|
|
|
6
5
|
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from './shared.js'
|
|
7
6
|
|
|
8
7
|
export function markdown() {
|
|
9
8
|
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
10
9
|
const config = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
markdown: markdownPlugin,
|
|
15
|
-
},
|
|
16
|
-
processor: 'markdown/markdown',
|
|
17
|
-
},
|
|
10
|
+
// @ts-expect-error: @types/eslint-plugin-markdown is not up to date
|
|
11
|
+
...markdownPlugin.configs.recommended,
|
|
12
|
+
|
|
18
13
|
{
|
|
19
14
|
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
20
|
-
languageOptions: {
|
|
21
|
-
parserOptions: {
|
|
22
|
-
ecmaFeatures: {
|
|
23
|
-
impliedStrict: true,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
plugins: {
|
|
28
|
-
// @ts-expect-error: wrong typing
|
|
29
|
-
'@typescript-eslint': tsPlugin,
|
|
30
|
-
},
|
|
31
15
|
rules: {
|
|
32
16
|
'@typescript-eslint/no-redeclare': 'off',
|
|
33
17
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
34
18
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
35
19
|
'@typescript-eslint/no-var-requires': 'off',
|
|
20
|
+
|
|
36
21
|
'no-alert': 'off',
|
|
37
22
|
'no-console': 'off',
|
|
38
23
|
'no-restricted-imports': 'off',
|
|
39
|
-
|
|
40
|
-
// Below are taken from https://github.com/eslint/eslint-plugin-markdown/blob/v3.0.0/lib/index.js#L31-L52
|
|
41
|
-
|
|
42
|
-
// The Markdown parser automatically trims trailing
|
|
43
|
-
// newlines from code blocks.
|
|
44
|
-
'eol-last': 'off',
|
|
45
|
-
|
|
46
|
-
// In code snippets and examples, these rules are often
|
|
47
|
-
// counterproductive to clarity and brevity.
|
|
48
|
-
'no-undef': 'off',
|
|
49
|
-
'no-unused-expressions': 'off',
|
|
50
|
-
'no-unused-vars': 'off',
|
|
51
|
-
'padded-blocks': 'off',
|
|
52
|
-
|
|
53
|
-
// Adding a "use strict" directive at the top of every
|
|
54
|
-
// code block is tedious and distracting. The config
|
|
55
|
-
// opts into strict mode parsing without the directive.
|
|
56
|
-
strict: 'off',
|
|
57
|
-
|
|
58
|
-
// The processor will not receive a Unicode Byte Order
|
|
59
|
-
// Mark from the Markdown parser.
|
|
60
|
-
'unicode-bom': 'off',
|
|
61
24
|
},
|
|
62
25
|
},
|
|
63
26
|
]
|
package/src/typescript.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/// <reference types="@eslint-types/typescript-eslint" />
|
|
4
|
+
|
|
5
5
|
import deprecationPlugin from 'eslint-plugin-deprecation'
|
|
6
|
+
import tseslint from 'typescript-eslint'
|
|
6
7
|
|
|
7
8
|
import { GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX } from './shared.js'
|
|
8
9
|
|
|
9
|
-
export {
|
|
10
|
+
export { tseslint }
|
|
10
11
|
|
|
11
12
|
export function typescript() {
|
|
13
|
+
const rules = [...tseslint.configs.recommended, ...tseslint.configs.stylistic]
|
|
14
|
+
.map((config) => config.rules || {})
|
|
15
|
+
.reduce((acc, cur) => ({ ...acc, ...cur }), {})
|
|
16
|
+
|
|
12
17
|
/** @type {import('eslint-define-config').FlatESLintConfig[]} */
|
|
13
18
|
const config = [
|
|
14
19
|
{
|
|
15
20
|
files: [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
|
|
16
21
|
languageOptions: {
|
|
17
|
-
parser:
|
|
22
|
+
parser: tseslint.parser,
|
|
18
23
|
parserOptions: {
|
|
19
24
|
project: true,
|
|
20
25
|
sourceType: 'module',
|
|
@@ -22,15 +27,13 @@ export function typescript() {
|
|
|
22
27
|
},
|
|
23
28
|
},
|
|
24
29
|
plugins: {
|
|
25
|
-
// @ts-expect-error:
|
|
26
|
-
'@typescript-eslint':
|
|
27
|
-
// @ts-expect-error:
|
|
30
|
+
// @ts-expect-error: conflict type
|
|
31
|
+
'@typescript-eslint': tseslint.plugin,
|
|
32
|
+
// @ts-expect-error: conflict type
|
|
28
33
|
deprecation: deprecationPlugin,
|
|
29
34
|
},
|
|
30
35
|
rules: {
|
|
31
|
-
...
|
|
32
|
-
...tsPlugin.configs['recommended-type-checked'].rules,
|
|
33
|
-
...tsPlugin.configs['stylistic-type-checked'].rules,
|
|
36
|
+
...rules,
|
|
34
37
|
|
|
35
38
|
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
36
39
|
'@typescript-eslint/prefer-optional-chain': 'off',
|
|
@@ -75,6 +78,7 @@ export function typescript() {
|
|
|
75
78
|
{
|
|
76
79
|
files: [GLOB_JS, GLOB_JSX],
|
|
77
80
|
rules: {
|
|
81
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
78
82
|
'@typescript-eslint/no-var-requires': 'off',
|
|
79
83
|
},
|
|
80
84
|
},
|