@ntnyq/eslint-config 2.0.0-beta.6 → 2.0.0-beta.7
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/index.d.ts +11 -0
- package/dist/index.js +51 -15
- package/package.json +15 -6
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { default as tsParser } from '@typescript-eslint/parser';
|
|
|
3
3
|
export { default as tsPlugin } from '@typescript-eslint/eslint-plugin';
|
|
4
4
|
export { default as vueParser } from 'vue-eslint-parser';
|
|
5
5
|
export { default as vuePlugin } from 'eslint-plugin-vue';
|
|
6
|
+
export { default as reactPlugin } from 'eslint-plugin-react';
|
|
7
|
+
export { default as reactHooksPlugin } from 'eslint-plugin-react-hooks';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* @file shared constants
|
|
@@ -30,8 +32,17 @@ declare const GLOB_DIST = "**/dist/**";
|
|
|
30
32
|
declare const GLOB_LOCKFILE: string[];
|
|
31
33
|
declare const GLOB_EXCLUDE: string[];
|
|
32
34
|
|
|
35
|
+
/**
|
|
36
|
+
* no framework
|
|
37
|
+
*/
|
|
33
38
|
declare const basic: FlatESLintConfig[];
|
|
39
|
+
/**
|
|
40
|
+
* all supported framework
|
|
41
|
+
*/
|
|
34
42
|
declare const all: FlatESLintConfig[];
|
|
43
|
+
/**
|
|
44
|
+
* custom framework support
|
|
45
|
+
*/
|
|
35
46
|
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, react: enableReact, astro: enableAstro, prettier: enablePrettier, markdown: enableMarkdown, }?: {
|
|
36
47
|
vue?: boolean | undefined;
|
|
37
48
|
react?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -678,7 +678,35 @@ var yml = [
|
|
|
678
678
|
];
|
|
679
679
|
|
|
680
680
|
// src/configs/react.ts
|
|
681
|
-
|
|
681
|
+
import reactPlugin from "eslint-plugin-react";
|
|
682
|
+
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
683
|
+
var react = [
|
|
684
|
+
{
|
|
685
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
686
|
+
plugins: {
|
|
687
|
+
react: reactPlugin,
|
|
688
|
+
reactHooks: reactHooksPlugin
|
|
689
|
+
},
|
|
690
|
+
settings: {
|
|
691
|
+
react: {
|
|
692
|
+
version: "18.0"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
languageOptions: {
|
|
696
|
+
parserOptions: {
|
|
697
|
+
ecmaFeatures: {
|
|
698
|
+
jsx: true
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
rules: {
|
|
703
|
+
...reactPlugin.configs.recommended.rules,
|
|
704
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
705
|
+
"jsx-quotes": ["error", "prefer-double"],
|
|
706
|
+
"react/react-in-jsx-scope": "off"
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
];
|
|
682
710
|
|
|
683
711
|
// src/configs/astro.ts
|
|
684
712
|
import astroPlugin, { configs as configs2 } from "eslint-plugin-astro";
|
|
@@ -893,42 +921,48 @@ var eslintComments = [
|
|
|
893
921
|
];
|
|
894
922
|
|
|
895
923
|
// src/presets.ts
|
|
924
|
+
var GLOBAL_IGNORE = { ignores: GLOB_EXCLUDE };
|
|
896
925
|
var basic = [
|
|
897
|
-
|
|
926
|
+
GLOBAL_IGNORE,
|
|
898
927
|
...js,
|
|
899
928
|
...jsx,
|
|
900
929
|
...ts,
|
|
901
|
-
...vue,
|
|
902
930
|
...yml,
|
|
903
931
|
...imports,
|
|
904
932
|
...unicorn,
|
|
905
933
|
...jsonc,
|
|
906
934
|
...pkgOrder,
|
|
907
|
-
...markdown,
|
|
908
935
|
...eslintComments
|
|
909
936
|
];
|
|
910
|
-
var all = [
|
|
937
|
+
var all = [
|
|
938
|
+
...basic,
|
|
939
|
+
...vue,
|
|
940
|
+
...react,
|
|
941
|
+
...astro,
|
|
942
|
+
...prettier,
|
|
943
|
+
...markdown
|
|
944
|
+
];
|
|
911
945
|
function ntnyq(config = [], {
|
|
912
|
-
vue: enableVue =
|
|
913
|
-
react: enableReact =
|
|
914
|
-
astro: enableAstro =
|
|
915
|
-
prettier: enablePrettier =
|
|
916
|
-
markdown: enableMarkdown =
|
|
946
|
+
vue: enableVue = false,
|
|
947
|
+
react: enableReact = false,
|
|
948
|
+
astro: enableAstro = false,
|
|
949
|
+
prettier: enablePrettier = false,
|
|
950
|
+
markdown: enableMarkdown = false
|
|
917
951
|
} = {}) {
|
|
918
952
|
const configs4 = [...basic];
|
|
919
|
-
if (enableVue
|
|
953
|
+
if (enableVue) {
|
|
920
954
|
configs4.push(...vue);
|
|
921
955
|
}
|
|
922
|
-
if (enableReact
|
|
956
|
+
if (enableReact) {
|
|
923
957
|
configs4.push(...react);
|
|
924
958
|
}
|
|
925
|
-
if (enableAstro
|
|
959
|
+
if (enableAstro) {
|
|
926
960
|
configs4.push(...astro);
|
|
927
961
|
}
|
|
928
|
-
if (enableMarkdown
|
|
962
|
+
if (enableMarkdown) {
|
|
929
963
|
configs4.push(...markdown);
|
|
930
964
|
}
|
|
931
|
-
if (enablePrettier
|
|
965
|
+
if (enablePrettier) {
|
|
932
966
|
configs4.push(...prettier);
|
|
933
967
|
}
|
|
934
968
|
if (Object.keys(config).length > 0) {
|
|
@@ -973,6 +1007,8 @@ export {
|
|
|
973
1007
|
pkgOrder,
|
|
974
1008
|
prettier,
|
|
975
1009
|
react,
|
|
1010
|
+
reactHooksPlugin,
|
|
1011
|
+
reactPlugin,
|
|
976
1012
|
ts,
|
|
977
1013
|
tsParser,
|
|
978
1014
|
tsPlugin,
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.7",
|
|
5
5
|
"packageManager": "pnpm@8.2.0",
|
|
6
|
-
"description": "",
|
|
7
|
-
"keywords": [
|
|
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
|
},
|
|
18
|
+
"repository": "ntnyq/eslint-config",
|
|
13
19
|
"exports": "./dist/index.js",
|
|
14
20
|
"main": "./dist/index.js",
|
|
15
21
|
"module": "./dist/index.js",
|
|
@@ -29,15 +35,17 @@
|
|
|
29
35
|
"@typescript-eslint/parser": "^5.58.0",
|
|
30
36
|
"astro-eslint-parser": "^0.13.3",
|
|
31
37
|
"eslint-config-prettier": "^8.8.0",
|
|
32
|
-
"eslint-define-config": "^1.
|
|
38
|
+
"eslint-define-config": "^1.18.0",
|
|
33
39
|
"eslint-plugin-astro": "^0.26.1",
|
|
34
40
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
35
41
|
"eslint-plugin-import": "^2.27.5",
|
|
36
42
|
"eslint-plugin-jsonc": "^2.7.0",
|
|
37
43
|
"eslint-plugin-markdown": "^3.0.0",
|
|
38
44
|
"eslint-plugin-prettier": "^4.2.1",
|
|
45
|
+
"eslint-plugin-react": "^7.32.2",
|
|
46
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
39
47
|
"eslint-plugin-unicorn": "^46.0.0",
|
|
40
|
-
"eslint-plugin-vue": "^9.
|
|
48
|
+
"eslint-plugin-vue": "^9.11.0",
|
|
41
49
|
"eslint-plugin-yml": "^1.5.0",
|
|
42
50
|
"globals": "^13.20.0",
|
|
43
51
|
"jsonc-eslint-parser": "^2.2.0",
|
|
@@ -68,6 +76,7 @@
|
|
|
68
76
|
"build": "tsup",
|
|
69
77
|
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint .",
|
|
70
78
|
"postinstall": "pnpm run build",
|
|
71
|
-
"release": "bumpp && pnpm publish --tag next"
|
|
79
|
+
"release": "bumpp && pnpm publish --tag next",
|
|
80
|
+
"typecheck": "tsc --noEmit"
|
|
72
81
|
}
|
|
73
82
|
}
|