@aiou/eslint-config 1.2.2 → 1.3.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/index.cjs +9 -3
- package/dist/index.mjs +9 -3
- package/dts/globs.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -56,7 +56,8 @@ const ignores = () => {
|
|
|
56
56
|
const GLOB_SCRIPT_EXT = "?([cm])[jt]s?(x)";
|
|
57
57
|
const GLOB_TEST_SCRIPT = "**/*.{spec,test}.?([cm])[jt]s?(x)";
|
|
58
58
|
const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
|
|
59
|
-
const GLOB_PAGES_DIRS = "**/{pages,routes}
|
|
59
|
+
const GLOB_PAGES_DIRS = "**/{pages,routes}/**";
|
|
60
|
+
const GLOB_PAGES_COMPONENTS_DIRS = "**/{pages,routes}/components/**";
|
|
60
61
|
const GLOB_DTS = "**/*.d.ts";
|
|
61
62
|
const GLOB_TS = "**/*.?([cm])ts";
|
|
62
63
|
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
@@ -99,8 +100,8 @@ const imports = () => {
|
|
|
99
100
|
// Absolute imports and other imports such as `@/foo` or `~/foo`.
|
|
100
101
|
// Anything not matched in another group.
|
|
101
102
|
["^", "^\\.", "^@/\\w", "^~/\\w"],
|
|
102
|
-
// Virtual modules prefixed with `virtual
|
|
103
|
-
["^virtual:"],
|
|
103
|
+
// Virtual modules prefixed with `virtual:` or `virtual-`, rollup & vite favor
|
|
104
|
+
["^virtual:", "^virtual-"],
|
|
104
105
|
// Types
|
|
105
106
|
["^[^/\\.].*\0$", "^\\..*\0$"]
|
|
106
107
|
]
|
|
@@ -156,6 +157,8 @@ const imports = () => {
|
|
|
156
157
|
`**/App*.${GLOB_SCRIPT_EXT}`,
|
|
157
158
|
`**/Document.${GLOB_SCRIPT_EXT}`,
|
|
158
159
|
"**/{vite,esbuild,rollup,webpack,rspack}.ts",
|
|
160
|
+
// Allow default export in page and route file
|
|
161
|
+
`**/{page,route}.${GLOB_SCRIPT_EXT}`,
|
|
159
162
|
GLOB_DTS,
|
|
160
163
|
GLOB_TEST_SCRIPT,
|
|
161
164
|
GLOB_TEST_DIRS
|
|
@@ -4017,6 +4020,9 @@ const react = () => {
|
|
|
4017
4020
|
// RECOMMEND: pages/routes should only contain page files
|
|
4018
4021
|
GLOB_PAGES_DIRS
|
|
4019
4022
|
],
|
|
4023
|
+
ignores: [
|
|
4024
|
+
GLOB_PAGES_COMPONENTS_DIRS
|
|
4025
|
+
],
|
|
4020
4026
|
rules: {
|
|
4021
4027
|
"react-refresh/only-export-components": "off"
|
|
4022
4028
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,8 @@ const ignores = () => {
|
|
|
54
54
|
const GLOB_SCRIPT_EXT = "?([cm])[jt]s?(x)";
|
|
55
55
|
const GLOB_TEST_SCRIPT = "**/*.{spec,test}.?([cm])[jt]s?(x)";
|
|
56
56
|
const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
|
|
57
|
-
const GLOB_PAGES_DIRS = "**/{pages,routes}
|
|
57
|
+
const GLOB_PAGES_DIRS = "**/{pages,routes}/**";
|
|
58
|
+
const GLOB_PAGES_COMPONENTS_DIRS = "**/{pages,routes}/components/**";
|
|
58
59
|
const GLOB_DTS = "**/*.d.ts";
|
|
59
60
|
const GLOB_TS = "**/*.?([cm])ts";
|
|
60
61
|
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
@@ -97,8 +98,8 @@ const imports = () => {
|
|
|
97
98
|
// Absolute imports and other imports such as `@/foo` or `~/foo`.
|
|
98
99
|
// Anything not matched in another group.
|
|
99
100
|
["^", "^\\.", "^@/\\w", "^~/\\w"],
|
|
100
|
-
// Virtual modules prefixed with `virtual
|
|
101
|
-
["^virtual:"],
|
|
101
|
+
// Virtual modules prefixed with `virtual:` or `virtual-`, rollup & vite favor
|
|
102
|
+
["^virtual:", "^virtual-"],
|
|
102
103
|
// Types
|
|
103
104
|
["^[^/\\.].*\0$", "^\\..*\0$"]
|
|
104
105
|
]
|
|
@@ -154,6 +155,8 @@ const imports = () => {
|
|
|
154
155
|
`**/App*.${GLOB_SCRIPT_EXT}`,
|
|
155
156
|
`**/Document.${GLOB_SCRIPT_EXT}`,
|
|
156
157
|
"**/{vite,esbuild,rollup,webpack,rspack}.ts",
|
|
158
|
+
// Allow default export in page and route file
|
|
159
|
+
`**/{page,route}.${GLOB_SCRIPT_EXT}`,
|
|
157
160
|
GLOB_DTS,
|
|
158
161
|
GLOB_TEST_SCRIPT,
|
|
159
162
|
GLOB_TEST_DIRS
|
|
@@ -4015,6 +4018,9 @@ const react = () => {
|
|
|
4015
4018
|
// RECOMMEND: pages/routes should only contain page files
|
|
4016
4019
|
GLOB_PAGES_DIRS
|
|
4017
4020
|
],
|
|
4021
|
+
ignores: [
|
|
4022
|
+
GLOB_PAGES_COMPONENTS_DIRS
|
|
4023
|
+
],
|
|
4018
4024
|
rules: {
|
|
4019
4025
|
"react-refresh/only-export-components": "off"
|
|
4020
4026
|
}
|
package/dts/globs.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare const GLOB_SCRIPT_EXT = "?([cm])[jt]s?(x)";
|
|
2
2
|
export declare const GLOB_TEST_SCRIPT = "**/*.{spec,test}.?([cm])[jt]s?(x)";
|
|
3
3
|
export declare const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
|
|
4
|
-
export declare const GLOB_PAGES_DIRS = "**/{pages,routes}
|
|
4
|
+
export declare const GLOB_PAGES_DIRS = "**/{pages,routes}/**";
|
|
5
|
+
export declare const GLOB_PAGES_COMPONENTS_DIRS = "**/{pages,routes}/components/**";
|
|
5
6
|
export declare const GLOB_DTS = "**/*.d.ts";
|
|
6
7
|
export declare const GLOB_TS = "**/*.?([cm])ts";
|
|
7
8
|
export declare const GLOB_TSX = "**/*.?([cm])tsx";
|