@schoero/configs 0.0.0-beta.2 → 0.0.0-beta.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.
Files changed (2) hide show
  1. package/eslint/imports.js +73 -58
  2. package/package.json +1 -1
package/eslint/imports.js CHANGED
@@ -3,79 +3,94 @@ import eslintPluginImportNewlines from "eslint-plugin-import-newlines";
3
3
  import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
4
4
  import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
5
5
 
6
- /** @type { import("eslint").Linter.FlatConfig[] } */
7
- export const imports = [
8
- {
9
- files: ["**/*.{js,jsx,cjs,mjs,ts,tsx}"],
10
- plugins: {
11
- "eslint-plugin-unused-imports": eslintPluginUnusedImports,
12
- "eslint-plugin-import-newlines": eslintPluginImportNewlines,
13
- "eslint-plugin-import": eslintPluginImport,
14
- "eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
15
- },
16
- rules: {
17
- "eslint-plugin-unused-imports/no-unused-imports": "warn",
18
- "eslint-plugin-unused-imports/no-unused-vars": "off",
6
+ import eslintParserTypeScript from "@typescript-eslint/parser";
7
+
19
8
 
20
- "eslint-plugin-import/first": "warn",
21
- "eslint-plugin-import/newline-after-import": ["warn", { count: 2 }],
22
- "eslint-plugin-import/no-duplicates": "warn",
23
- "eslint-plugin-import/no-self-import": "warn",
24
- "eslint-plugin-import/no-useless-path-segments": ["warn", { noUselessIndex: false }],
9
+ const importRules = {
10
+ "eslint-plugin-unused-imports/no-unused-imports": "warn",
11
+ "eslint-plugin-unused-imports/no-unused-vars": "off",
25
12
 
26
- "eslint-plugin-import-newlines/enforce": ["warn", { "items": 6, "max-len": 119 }],
13
+ "eslint-plugin-import/first": "warn",
14
+ "eslint-plugin-import/newline-after-import": ["warn", { count: 2 }],
15
+ "eslint-plugin-import/no-duplicates": "warn",
16
+ "eslint-plugin-import/no-self-import": "warn",
17
+ "eslint-plugin-import/no-useless-path-segments": ["warn", { noUselessIndex: false }],
27
18
 
28
- "eslint-plugin-simple-import-sort/exports": "warn",
29
- "eslint-plugin-simple-import-sort/imports": [
30
- "warn",
31
- {
32
- groups: [
19
+ "eslint-plugin-import-newlines/enforce": ["warn", { "items": 6, "max-len": 119 }],
33
20
 
34
- // side effect imports
35
- ["^\\u0000"],
21
+ "eslint-plugin-simple-import-sort/exports": "warn",
22
+ "eslint-plugin-simple-import-sort/imports": ["warn", {
23
+ groups: [
36
24
 
37
- // node builtins
38
- ["^node:"],
25
+ // side effect imports
26
+ ["^\\u0000"],
39
27
 
40
- // external packages
41
- ["^"],
28
+ // node builtins
29
+ ["^node:"],
42
30
 
43
- // internal packages
44
- ["^@"],
45
- ["^@schoero"],
46
- ["^(?!node:)(.*):"],
31
+ // external packages
32
+ ["^"],
47
33
 
48
- // parent imports. Put `..` last
49
- ["^\\.\\.(?!/?.*\\u0000$)", "^\\.\\./?(?!.*\\u0000$)"],
34
+ // internal packages
35
+ ["^@"],
36
+ ["^@schoero"],
37
+ ["^(?!node:)(.*):"],
50
38
 
51
- // other relative imports. Put same-folder imports and `.` last
52
- ["^\\./(?=.*/)(?!/?.*\\u0000$)", "^\\.(?!/?.*\\u0000$)", "^\\./?(?!.*\\u0000$)"],
39
+ // parent imports. Put `..` last
40
+ ["^\\.\\.(?!/?.*\\u0000$)", "^\\.\\./?(?!.*\\u0000$)"],
53
41
 
54
- // style imports
55
- ["^.+\\.s?css$"],
42
+ // other relative imports. Put same-folder imports and `.` last
43
+ ["^\\./(?=.*/)(?!/?.*\\u0000$)", "^\\.(?!/?.*\\u0000$)", "^\\./?(?!.*\\u0000$)"],
56
44
 
57
- // json imports
58
- ["^.+\\.jsonc?$"],
45
+ // style imports
46
+ ["^.+\\.s?css$"],
59
47
 
60
- // type imports
61
- ["^node:(.*)\\u0000$"],
48
+ // json imports
49
+ ["^.+\\.jsonc?$"],
62
50
 
63
- // types from external packages
64
- ["\\u0000$"],
51
+ // type imports
52
+ ["^node:(.*)\\u0000$"],
65
53
 
66
- // types from internal packages
67
- ["^@(.*)\\u0000$"],
68
- ["^@schoero(.*)\\u0000$"],
69
- ["^(?!node:)(.*):(.*)\\u0000$"],
54
+ // types from external packages
55
+ ["\\u0000$"],
70
56
 
71
- // types from parent imports. Put `..` last
72
- ["^\\.\\.(?=/?\\u0000$)", "^\\.\\./?\\u0000$"],
57
+ // types from internal packages
58
+ ["^@(.*)\\u0000$"],
59
+ ["^@schoero(.*)\\u0000$"],
60
+ ["^(?!node:)(.*):(.*)\\u0000$"],
73
61
 
74
- // types from other relative imports. Put same-folder imports and `.` last
75
- ["^\\./(?=.*\\u0000$)", "^\\.(?=/?\\u0000$)", "^\\./?\\u0000$"]
76
- ]
77
- }
78
- ]
79
- }
62
+ // types from parent imports. Put `..` last
63
+ ["^\\.\\.(?=/?\\u0000$)", "^\\.\\./?\\u0000$"],
64
+
65
+ // types from other relative imports. Put same-folder imports and `.` last
66
+ ["^\\./(?=.*\\u0000$)", "^\\.(?=/?\\u0000$)", "^\\./?\\u0000$"]
67
+ ]
68
+ }]
69
+ };
70
+
71
+ /** @type { import("eslint").Linter.FlatConfig[] } */
72
+ export const imports = [
73
+ {
74
+ files: ["**/*.{js,jsx,cjs,mjs}"],
75
+ plugins: {
76
+ "eslint-plugin-unused-imports": eslintPluginUnusedImports,
77
+ "eslint-plugin-import-newlines": eslintPluginImportNewlines,
78
+ "eslint-plugin-import": eslintPluginImport,
79
+ "eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
80
+ },
81
+ rules: importRules
82
+ },
83
+ {
84
+ files: ["**/*.{ts,tsx}"],
85
+ languageOptions: {
86
+ parserOptions: {
87
+ project: "./tsconfig.json"
88
+ },
89
+ parser: eslintParserTypeScript
90
+ },
91
+ plugins: {
92
+ "eslint-plugin-unused-imports": eslintPluginUnusedImports
93
+ },
94
+ rules: importRules
80
95
  }
81
96
  ];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.0-beta.2",
2
+ "version": "0.0.0-beta.3",
3
3
  "type": "module",
4
4
  "name": "@schoero/configs",
5
5
  "description": "",