@aiou/eslint-config 1.2.0 → 1.2.2

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 CHANGED
@@ -38,9 +38,15 @@ module.exports = aiou()
38
38
 
39
39
  #### `options.ssr`
40
40
 
41
- - default: `false`
41
+ - default: `true`
42
42
 
43
43
  enabled ssr-friendly rules
44
+
45
+ #### `options.regexp`
46
+
47
+ - default: `true`
48
+
49
+ enabled regexp rules
44
50
 
45
51
  ## rules
46
52
 
@@ -51,7 +57,7 @@ eslint-config-standard
51
57
  eslint-plugin-eslint-comments
52
58
  eslint-plugin-html
53
59
  eslint-plugin-i
54
- eslint-plugin-regexp
60
+ eslint-plugin-regexp (configured when regexp enabled)
55
61
  eslint-plugin-markdown
56
62
  eslint-plugin-simple-import-sort
57
63
  eslint-plugin-import-newlines
package/dist/index.cjs CHANGED
@@ -56,6 +56,7 @@ 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}/!(components)/**";
59
60
  const GLOB_DTS = "**/*.d.ts";
60
61
  const GLOB_TS = "**/*.?([cm])ts";
61
62
  const GLOB_TSX = "**/*.?([cm])tsx";
@@ -4008,9 +4009,13 @@ const react = () => {
4008
4009
  {
4009
4010
  files: [
4010
4011
  `**/*config*.${GLOB_SCRIPT_EXT}`,
4011
- `**/*{-entry,.entry}*.${GLOB_SCRIPT_EXT}`,
4012
+ `**/*{-entry,entry.}*.${GLOB_SCRIPT_EXT}`,
4012
4013
  GLOB_TEST_SCRIPT,
4013
- GLOB_TEST_DIRS
4014
+ GLOB_TEST_DIRS,
4015
+ // With next.js pages will export getStaticProps funcs
4016
+ // There are some bad cases for not all files are route files
4017
+ // RECOMMEND: pages/routes should only contain page files
4018
+ GLOB_PAGES_DIRS
4014
4019
  ],
4015
4020
  rules: {
4016
4021
  "react-refresh/only-export-components": "off"
@@ -4045,6 +4050,8 @@ const ssrReact = () => {
4045
4050
  {
4046
4051
  files: [
4047
4052
  `**/*config*.${GLOB_SCRIPT_EXT}`,
4053
+ // Client entry files not need to be SSR friendly
4054
+ `**/*{client-entry,entry.client}*.${GLOB_SCRIPT_EXT}`,
4048
4055
  GLOB_TEST_SCRIPT,
4049
4056
  GLOB_TEST_DIRS
4050
4057
  ],
package/dist/index.mjs CHANGED
@@ -54,6 +54,7 @@ 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}/!(components)/**";
57
58
  const GLOB_DTS = "**/*.d.ts";
58
59
  const GLOB_TS = "**/*.?([cm])ts";
59
60
  const GLOB_TSX = "**/*.?([cm])tsx";
@@ -4006,9 +4007,13 @@ const react = () => {
4006
4007
  {
4007
4008
  files: [
4008
4009
  `**/*config*.${GLOB_SCRIPT_EXT}`,
4009
- `**/*{-entry,.entry}*.${GLOB_SCRIPT_EXT}`,
4010
+ `**/*{-entry,entry.}*.${GLOB_SCRIPT_EXT}`,
4010
4011
  GLOB_TEST_SCRIPT,
4011
- GLOB_TEST_DIRS
4012
+ GLOB_TEST_DIRS,
4013
+ // With next.js pages will export getStaticProps funcs
4014
+ // There are some bad cases for not all files are route files
4015
+ // RECOMMEND: pages/routes should only contain page files
4016
+ GLOB_PAGES_DIRS
4012
4017
  ],
4013
4018
  rules: {
4014
4019
  "react-refresh/only-export-components": "off"
@@ -4043,6 +4048,8 @@ const ssrReact = () => {
4043
4048
  {
4044
4049
  files: [
4045
4050
  `**/*config*.${GLOB_SCRIPT_EXT}`,
4051
+ // Client entry files not need to be SSR friendly
4052
+ `**/*{client-entry,entry.client}*.${GLOB_SCRIPT_EXT}`,
4046
4053
  GLOB_TEST_SCRIPT,
4047
4054
  GLOB_TEST_DIRS
4048
4055
  ],
package/dts/globs.d.ts CHANGED
@@ -1,6 +1,7 @@
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}/!(components)/**";
4
5
  export declare const GLOB_DTS = "**/*.d.ts";
5
6
  export declare const GLOB_TS = "**/*.?([cm])ts";
6
7
  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.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "eslint config for aiou template",
5
5
  "keywords": [],
6
6
  "license": "MIT",