@aiou/eslint-config 1.0.1 → 1.0.3

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 CHANGED
@@ -54,7 +54,7 @@ const ignores = () => {
54
54
 
55
55
  const GLOB_SCRIPT_EXT = "?([cm])[jt]s?(x)";
56
56
  const GLOB_TEST_SCRIPT = "**/*.{spec,test}.?([cm])[jt]s?(x)";
57
- const GLOB_TEST_DIRS = "**/{test,tests,__test__,__tests__}/**";
57
+ const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
58
58
  const GLOB_DTS = "**/*.d.ts";
59
59
  const GLOB_TS = "**/*.?([cm])ts";
60
60
  const GLOB_TSX = "**/*.?([cm])tsx";
@@ -110,20 +110,8 @@ const imports = () => {
110
110
  "import/no-mutable-exports": "error",
111
111
  "import/no-unresolved": "off",
112
112
  "import/no-absolute-path": "off",
113
- "import/no-extraneous-dependencies": [
114
- "error",
115
- {
116
- devDependencies: [
117
- // ignore dev scripts
118
- "**/scripts/**/*.{js,jsx,ts,tsx,cjs,mjs}",
119
- "**/*.test.{js,jsx,ts,tsx,cjs,mjs}",
120
- "**/*.spec.{js,jsx,ts,tsx,mjs,cjs}",
121
- "**/*.config.{js,jsx,ts,tsx,cjs,mjs}",
122
- // ignore require third packages in .eslintrc.* e.g. eslint-define-config
123
- "**/.eslintrc.{js,cjs,mjs}"
124
- ]
125
- }
126
- ],
113
+ // Not allowed import devDependencies
114
+ "import/no-extraneous-dependencies": "error",
127
115
  // Not allow import { default as named }
128
116
  "import/no-named-default": "warn",
129
117
  "unused-imports/no-unused-imports": "error",
@@ -161,7 +149,7 @@ const imports = () => {
161
149
  {
162
150
  files: [
163
151
  `**/*config*.${GLOB_SCRIPT_EXT}`,
164
- `**/pages/**/*.${GLOB_SCRIPT_EXT}`,
152
+ `**/{pages,routes}/**/*.${GLOB_SCRIPT_EXT}`,
165
153
  "**/{index,vite,esbuild,rollup,webpack,rspack}.ts",
166
154
  GLOB_DTS
167
155
  ],
@@ -171,6 +159,24 @@ const imports = () => {
171
159
  "import/no-anonymous-default-export": "off",
172
160
  "import/no-default-export": "off"
173
161
  }
162
+ },
163
+ {
164
+ files: [
165
+ // ignore devDependencies on scripts files
166
+ `**/script?(s)/**/*.${GLOB_SCRIPT_EXT}`,
167
+ `**/**/script?(s).${GLOB_SCRIPT_EXT}`,
168
+ `**/*config*.${GLOB_SCRIPT_EXT}`,
169
+ // ignore devDependencies on test files
170
+ GLOB_TEST_SCRIPT,
171
+ GLOB_TEST_DIRS,
172
+ // ignore require third packages in .eslintrc.* e.g. eslint-define-config
173
+ `**/.eslintrc.${GLOB_SCRIPT_EXT}`,
174
+ `**/**/eslint.config.${GLOB_SCRIPT_EXT}`,
175
+ "**/{index,vite,esbuild,rollup,webpack,rspack}.ts"
176
+ ],
177
+ rules: {
178
+ "import/no-extraneous-dependencies": "off"
179
+ }
174
180
  }
175
181
  ];
176
182
  return config;
@@ -4168,7 +4174,8 @@ const typescript = () => {
4168
4174
  */
4169
4175
  "etc/no-const-enum": "error",
4170
4176
  "etc/no-enum": "error",
4171
- "etc/no-misused-generics": "error",
4177
+ // required tsconfig.json
4178
+ // 'etc/no-misused-generics': 'error',
4172
4179
  // Overrides JS
4173
4180
  // no-spaced-func alert -- https://eslint.org/docs/latest/rules/no-spaced-func
4174
4181
  "func-call-spacing": "off",
package/dist/index.mjs CHANGED
@@ -52,7 +52,7 @@ const ignores = () => {
52
52
 
53
53
  const GLOB_SCRIPT_EXT = "?([cm])[jt]s?(x)";
54
54
  const GLOB_TEST_SCRIPT = "**/*.{spec,test}.?([cm])[jt]s?(x)";
55
- const GLOB_TEST_DIRS = "**/{test,tests,__test__,__tests__}/**";
55
+ const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
56
56
  const GLOB_DTS = "**/*.d.ts";
57
57
  const GLOB_TS = "**/*.?([cm])ts";
58
58
  const GLOB_TSX = "**/*.?([cm])tsx";
@@ -108,20 +108,8 @@ const imports = () => {
108
108
  "import/no-mutable-exports": "error",
109
109
  "import/no-unresolved": "off",
110
110
  "import/no-absolute-path": "off",
111
- "import/no-extraneous-dependencies": [
112
- "error",
113
- {
114
- devDependencies: [
115
- // ignore dev scripts
116
- "**/scripts/**/*.{js,jsx,ts,tsx,cjs,mjs}",
117
- "**/*.test.{js,jsx,ts,tsx,cjs,mjs}",
118
- "**/*.spec.{js,jsx,ts,tsx,mjs,cjs}",
119
- "**/*.config.{js,jsx,ts,tsx,cjs,mjs}",
120
- // ignore require third packages in .eslintrc.* e.g. eslint-define-config
121
- "**/.eslintrc.{js,cjs,mjs}"
122
- ]
123
- }
124
- ],
111
+ // Not allowed import devDependencies
112
+ "import/no-extraneous-dependencies": "error",
125
113
  // Not allow import { default as named }
126
114
  "import/no-named-default": "warn",
127
115
  "unused-imports/no-unused-imports": "error",
@@ -159,7 +147,7 @@ const imports = () => {
159
147
  {
160
148
  files: [
161
149
  `**/*config*.${GLOB_SCRIPT_EXT}`,
162
- `**/pages/**/*.${GLOB_SCRIPT_EXT}`,
150
+ `**/{pages,routes}/**/*.${GLOB_SCRIPT_EXT}`,
163
151
  "**/{index,vite,esbuild,rollup,webpack,rspack}.ts",
164
152
  GLOB_DTS
165
153
  ],
@@ -169,6 +157,24 @@ const imports = () => {
169
157
  "import/no-anonymous-default-export": "off",
170
158
  "import/no-default-export": "off"
171
159
  }
160
+ },
161
+ {
162
+ files: [
163
+ // ignore devDependencies on scripts files
164
+ `**/script?(s)/**/*.${GLOB_SCRIPT_EXT}`,
165
+ `**/**/script?(s).${GLOB_SCRIPT_EXT}`,
166
+ `**/*config*.${GLOB_SCRIPT_EXT}`,
167
+ // ignore devDependencies on test files
168
+ GLOB_TEST_SCRIPT,
169
+ GLOB_TEST_DIRS,
170
+ // ignore require third packages in .eslintrc.* e.g. eslint-define-config
171
+ `**/.eslintrc.${GLOB_SCRIPT_EXT}`,
172
+ `**/**/eslint.config.${GLOB_SCRIPT_EXT}`,
173
+ "**/{index,vite,esbuild,rollup,webpack,rspack}.ts"
174
+ ],
175
+ rules: {
176
+ "import/no-extraneous-dependencies": "off"
177
+ }
172
178
  }
173
179
  ];
174
180
  return config;
@@ -4166,7 +4172,8 @@ const typescript = () => {
4166
4172
  */
4167
4173
  "etc/no-const-enum": "error",
4168
4174
  "etc/no-enum": "error",
4169
- "etc/no-misused-generics": "error",
4175
+ // required tsconfig.json
4176
+ // 'etc/no-misused-generics': 'error',
4170
4177
  // Overrides JS
4171
4178
  // no-spaced-func alert -- https://eslint.org/docs/latest/rules/no-spaced-func
4172
4179
  "func-call-spacing": "off",
package/dts/globs.d.ts CHANGED
@@ -1,6 +1,6 @@
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
- export declare const GLOB_TEST_DIRS = "**/{test,tests,__test__,__tests__}/**";
3
+ export declare const GLOB_TEST_DIRS = "**/{test,tests,e2e,__test__,__tests__}/**";
4
4
  export declare const GLOB_DTS = "**/*.d.ts";
5
5
  export declare const GLOB_TS = "**/*.?([cm])ts";
6
6
  export declare const GLOB_TSX = "**/*.?([cm])tsx";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiou/eslint-config",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "eslint config for aiou template",
5
5
  "keywords": [],
6
6
  "license": "MIT",