@debbl/eslint-config 2.0.0 → 2.1.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 +1 -1
- package/dist/index.cjs +18 -6
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +17 -6
- package/package.json +20 -18
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# [@debbl/eslint-config](https://github.com/Debbl/eslint-config)
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.com/package/@debbl/eslint-config)
|
|
4
4
|
|
|
5
5
|
## 参考
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
GLOB_LESS: () => GLOB_LESS,
|
|
43
43
|
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
44
44
|
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
45
|
+
GLOB_MDX: () => GLOB_MDX,
|
|
45
46
|
GLOB_SCSS: () => GLOB_SCSS,
|
|
46
47
|
GLOB_SRC: () => GLOB_SRC,
|
|
47
48
|
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
@@ -115,11 +116,12 @@ var GLOB_SCSS = "**/*.scss";
|
|
|
115
116
|
var GLOB_JSON = "**/*.json";
|
|
116
117
|
var GLOB_JSON5 = "**/*.json5";
|
|
117
118
|
var GLOB_JSONC = "**/*.jsonc";
|
|
118
|
-
var GLOB_MARKDOWN = "**/*.md
|
|
119
|
+
var GLOB_MARKDOWN = "**/*.md";
|
|
120
|
+
var GLOB_MDX = "**/*.mdx";
|
|
121
|
+
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
119
122
|
var GLOB_VUE = "**/*.vue";
|
|
120
123
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
121
124
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
122
|
-
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
123
125
|
var GLOB_TESTS = [
|
|
124
126
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
125
127
|
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
@@ -596,18 +598,27 @@ async function jsonc() {
|
|
|
596
598
|
// src/configs/markdown.ts
|
|
597
599
|
async function markdown(options = {}) {
|
|
598
600
|
const { componentExts = [] } = options;
|
|
601
|
+
const pluginMdx = await import("eslint-plugin-mdx");
|
|
602
|
+
const parserMdx = await import("eslint-mdx");
|
|
599
603
|
return [
|
|
600
604
|
{
|
|
601
605
|
name: "eslint:markdown:setup",
|
|
602
606
|
plugins: {
|
|
603
|
-
|
|
604
|
-
markdown: await interopDefault(import("eslint-plugin-markdown"))
|
|
607
|
+
mdx: pluginMdx
|
|
605
608
|
}
|
|
606
609
|
},
|
|
607
610
|
{
|
|
608
611
|
name: "eslint:markdown:processor",
|
|
609
|
-
files: [GLOB_MARKDOWN],
|
|
610
|
-
|
|
612
|
+
files: [GLOB_MARKDOWN, GLOB_MDX],
|
|
613
|
+
languageOptions: {
|
|
614
|
+
ecmaVersion: "latest",
|
|
615
|
+
parser: parserMdx,
|
|
616
|
+
sourceType: "module"
|
|
617
|
+
},
|
|
618
|
+
processor: "mdx/remark",
|
|
619
|
+
settings: {
|
|
620
|
+
"mdx/code-blocks": true
|
|
621
|
+
}
|
|
611
622
|
},
|
|
612
623
|
{
|
|
613
624
|
name: "eslint:markdown:rules",
|
|
@@ -1526,6 +1537,7 @@ var src_default = config;
|
|
|
1526
1537
|
GLOB_LESS,
|
|
1527
1538
|
GLOB_MARKDOWN,
|
|
1528
1539
|
GLOB_MARKDOWN_CODE,
|
|
1540
|
+
GLOB_MDX,
|
|
1529
1541
|
GLOB_SCSS,
|
|
1530
1542
|
GLOB_SRC,
|
|
1531
1543
|
GLOB_SRC_EXT,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
2
2
|
import { RequiredOptions } from 'prettier';
|
|
3
|
-
import {
|
|
3
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
4
4
|
|
|
5
5
|
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
6
6
|
type Awaitable<T> = T | Promise<T>;
|
|
7
|
-
interface ConfigItem extends
|
|
7
|
+
interface ConfigItem extends FlatESLintConfig {
|
|
8
8
|
/**
|
|
9
9
|
* Custom name of each config item
|
|
10
10
|
*/
|
|
@@ -192,13 +192,14 @@ declare const GLOB_SCSS = "**/*.scss";
|
|
|
192
192
|
declare const GLOB_JSON = "**/*.json";
|
|
193
193
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
194
194
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
195
|
-
declare const GLOB_MARKDOWN = "**/*.md
|
|
195
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
196
|
+
declare const GLOB_MDX = "**/*.mdx";
|
|
197
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
196
198
|
declare const GLOB_VUE = "**/*.vue";
|
|
197
199
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
198
200
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
199
|
-
declare const GLOB_MARKDOWN_CODE = "**/*.md?(x)/**/*.?([cm])[jt]s?(x)";
|
|
200
201
|
declare const GLOB_TESTS: string[];
|
|
201
202
|
declare const GLOB_ALL_SRC: string[];
|
|
202
203
|
declare const GLOB_EXCLUDE: string[];
|
|
203
204
|
|
|
204
|
-
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
|
205
|
+
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
2
2
|
import { RequiredOptions } from 'prettier';
|
|
3
|
-
import {
|
|
3
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
4
4
|
|
|
5
5
|
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
6
6
|
type Awaitable<T> = T | Promise<T>;
|
|
7
|
-
interface ConfigItem extends
|
|
7
|
+
interface ConfigItem extends FlatESLintConfig {
|
|
8
8
|
/**
|
|
9
9
|
* Custom name of each config item
|
|
10
10
|
*/
|
|
@@ -192,13 +192,14 @@ declare const GLOB_SCSS = "**/*.scss";
|
|
|
192
192
|
declare const GLOB_JSON = "**/*.json";
|
|
193
193
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
194
194
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
195
|
-
declare const GLOB_MARKDOWN = "**/*.md
|
|
195
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
196
|
+
declare const GLOB_MDX = "**/*.mdx";
|
|
197
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
196
198
|
declare const GLOB_VUE = "**/*.vue";
|
|
197
199
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
198
200
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
199
|
-
declare const GLOB_MARKDOWN_CODE = "**/*.md?(x)/**/*.?([cm])[jt]s?(x)";
|
|
200
201
|
declare const GLOB_TESTS: string[];
|
|
201
202
|
declare const GLOB_ALL_SRC: string[];
|
|
202
203
|
declare const GLOB_EXCLUDE: string[];
|
|
203
204
|
|
|
204
|
-
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
|
205
|
+
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -38,11 +38,12 @@ var GLOB_SCSS = "**/*.scss";
|
|
|
38
38
|
var GLOB_JSON = "**/*.json";
|
|
39
39
|
var GLOB_JSON5 = "**/*.json5";
|
|
40
40
|
var GLOB_JSONC = "**/*.jsonc";
|
|
41
|
-
var GLOB_MARKDOWN = "**/*.md
|
|
41
|
+
var GLOB_MARKDOWN = "**/*.md";
|
|
42
|
+
var GLOB_MDX = "**/*.mdx";
|
|
43
|
+
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
42
44
|
var GLOB_VUE = "**/*.vue";
|
|
43
45
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
44
46
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
45
|
-
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
46
47
|
var GLOB_TESTS = [
|
|
47
48
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
48
49
|
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
@@ -519,18 +520,27 @@ async function jsonc() {
|
|
|
519
520
|
// src/configs/markdown.ts
|
|
520
521
|
async function markdown(options = {}) {
|
|
521
522
|
const { componentExts = [] } = options;
|
|
523
|
+
const pluginMdx = await import("eslint-plugin-mdx");
|
|
524
|
+
const parserMdx = await import("eslint-mdx");
|
|
522
525
|
return [
|
|
523
526
|
{
|
|
524
527
|
name: "eslint:markdown:setup",
|
|
525
528
|
plugins: {
|
|
526
|
-
|
|
527
|
-
markdown: await interopDefault(import("eslint-plugin-markdown"))
|
|
529
|
+
mdx: pluginMdx
|
|
528
530
|
}
|
|
529
531
|
},
|
|
530
532
|
{
|
|
531
533
|
name: "eslint:markdown:processor",
|
|
532
|
-
files: [GLOB_MARKDOWN],
|
|
533
|
-
|
|
534
|
+
files: [GLOB_MARKDOWN, GLOB_MDX],
|
|
535
|
+
languageOptions: {
|
|
536
|
+
ecmaVersion: "latest",
|
|
537
|
+
parser: parserMdx,
|
|
538
|
+
sourceType: "module"
|
|
539
|
+
},
|
|
540
|
+
processor: "mdx/remark",
|
|
541
|
+
settings: {
|
|
542
|
+
"mdx/code-blocks": true
|
|
543
|
+
}
|
|
534
544
|
},
|
|
535
545
|
{
|
|
536
546
|
name: "eslint:markdown:rules",
|
|
@@ -1448,6 +1458,7 @@ export {
|
|
|
1448
1458
|
GLOB_LESS,
|
|
1449
1459
|
GLOB_MARKDOWN,
|
|
1450
1460
|
GLOB_MARKDOWN_CODE,
|
|
1461
|
+
GLOB_MDX,
|
|
1451
1462
|
GLOB_SCSS,
|
|
1452
1463
|
GLOB_SRC,
|
|
1453
1464
|
GLOB_SRC_EXT,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "2.1.0",
|
|
5
|
+
"packageManager": "pnpm@8.11.0",
|
|
6
6
|
"description": "Brendan Dash's ESLint config",
|
|
7
7
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -24,31 +24,33 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": ">=8.
|
|
27
|
+
"eslint": ">=8.40.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@next/eslint-plugin-next": "^14.0.3",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
32
|
-
"@typescript-eslint/parser": "^6.
|
|
33
|
-
"eslint-config-prettier": "^9.
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
32
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
33
|
+
"eslint-config-prettier": "^9.1.0",
|
|
34
34
|
"eslint-define-config": "^2.0.0",
|
|
35
|
-
"eslint-
|
|
35
|
+
"eslint-mdx": "^2.2.0",
|
|
36
|
+
"eslint-plugin-antfu": "^2.0.0",
|
|
36
37
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
37
38
|
"eslint-plugin-i": "^2.29.0",
|
|
38
39
|
"eslint-plugin-jsdoc": "^46.9.0",
|
|
39
40
|
"eslint-plugin-jsonc": "^2.10.0",
|
|
40
41
|
"eslint-plugin-markdown": "^3.0.1",
|
|
42
|
+
"eslint-plugin-mdx": "^2.2.0",
|
|
41
43
|
"eslint-plugin-n": "^16.3.1",
|
|
42
44
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
43
|
-
"eslint-plugin-perfectionist": "^2.
|
|
45
|
+
"eslint-plugin-perfectionist": "^2.5.0",
|
|
44
46
|
"eslint-plugin-prettier": "^5.0.1",
|
|
45
47
|
"eslint-plugin-react": "^7.33.2",
|
|
46
48
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
47
49
|
"eslint-plugin-tailwindcss": "^3.13.0",
|
|
48
50
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
49
51
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
50
|
-
"eslint-plugin-vitest": "^0.3.
|
|
51
|
-
"eslint-plugin-vue": "^9.
|
|
52
|
+
"eslint-plugin-vitest": "^0.3.10",
|
|
53
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
52
54
|
"eslint-plugin-yml": "^1.10.0",
|
|
53
55
|
"globals": "^13.23.0",
|
|
54
56
|
"jsonc-eslint-parser": "^2.4.0",
|
|
@@ -57,20 +59,20 @@
|
|
|
57
59
|
"yaml-eslint-parser": "^1.2.2"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
|
-
"@types/eslint": "^8.44.
|
|
61
|
-
"@types/node": "^20.
|
|
62
|
-
"@types/react": "^18.2.
|
|
62
|
+
"@types/eslint": "^8.44.8",
|
|
63
|
+
"@types/node": "^20.10.3",
|
|
64
|
+
"@types/react": "^18.2.42",
|
|
63
65
|
"bumpp": "^9.2.0",
|
|
64
|
-
"eslint": "^8.
|
|
66
|
+
"eslint": "^8.55.0",
|
|
65
67
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
66
68
|
"execa": "^8.0.1",
|
|
67
69
|
"fast-glob": "^3.3.2",
|
|
68
|
-
"fs-extra": "^11.
|
|
70
|
+
"fs-extra": "^11.2.0",
|
|
69
71
|
"react": "^18.2.0",
|
|
70
72
|
"sucrase": "^3.34.0",
|
|
71
|
-
"tsup": "^8.0.
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vitest": "^0.
|
|
73
|
+
"tsup": "^8.0.1",
|
|
74
|
+
"typescript": "^5.3.2",
|
|
75
|
+
"vitest": "^1.0.1"
|
|
74
76
|
},
|
|
75
77
|
"scripts": {
|
|
76
78
|
"build": "tsup src/index.ts --format esm,cjs --clean --dts",
|