@rpcbase/eslint-config 0.0.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/eslint.config.js +89 -0
- package/package.json +49 -0
package/eslint.config.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import gitignore from "eslint-config-flat-gitignore"
|
|
2
|
+
import globals from "globals"
|
|
3
|
+
import pluginImport from "eslint-plugin-import"
|
|
4
|
+
import pluginJs from "@eslint/js"
|
|
5
|
+
import pluginReact from "eslint-plugin-react"
|
|
6
|
+
import tseslint from "typescript-eslint"
|
|
7
|
+
|
|
8
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
9
|
+
export const config = [
|
|
10
|
+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
|
11
|
+
gitignore(),
|
|
12
|
+
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
|
|
13
|
+
pluginJs.configs.recommended,
|
|
14
|
+
pluginImport.flatConfigs.recommended,
|
|
15
|
+
...tseslint.configs.recommended,
|
|
16
|
+
{
|
|
17
|
+
...pluginReact.configs.flat.recommended,
|
|
18
|
+
settings: {
|
|
19
|
+
react: {
|
|
20
|
+
version: "detect",
|
|
21
|
+
},
|
|
22
|
+
"import/resolver": {
|
|
23
|
+
typescript: {
|
|
24
|
+
project: "./app",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
...pluginReact.configs.flat.recommended.rules,
|
|
30
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
31
|
+
"@typescript-eslint/no-unused-vars": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
vars: "all",
|
|
35
|
+
args: "none",
|
|
36
|
+
argsIgnorePattern: "^_",
|
|
37
|
+
caughtErrors: "none",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"import/newline-after-import": ["error", { count: 2 }],
|
|
41
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/order.md
|
|
42
|
+
"import/order": [
|
|
43
|
+
"error",
|
|
44
|
+
{
|
|
45
|
+
"distinctGroup": true,
|
|
46
|
+
"groups": [
|
|
47
|
+
"builtin",
|
|
48
|
+
"external",
|
|
49
|
+
"internal",
|
|
50
|
+
// Then sibling and parent imports. They can be mingled together
|
|
51
|
+
["sibling", "parent"],
|
|
52
|
+
// Then index file imports
|
|
53
|
+
"index",
|
|
54
|
+
// Then any arcane TypeScript imports
|
|
55
|
+
"object",
|
|
56
|
+
// Then the omitted imports: internal, external, type, unknown
|
|
57
|
+
],
|
|
58
|
+
"pathGroups": [
|
|
59
|
+
{
|
|
60
|
+
"pattern": "@rpcbase/**",
|
|
61
|
+
"group": "internal",
|
|
62
|
+
"position": "before"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"pattern": "@/api/**",
|
|
66
|
+
"group": "internal",
|
|
67
|
+
"position": "before"
|
|
68
|
+
},
|
|
69
|
+
// {
|
|
70
|
+
// "pattern": "@/**",
|
|
71
|
+
// "group": "internal"
|
|
72
|
+
// }
|
|
73
|
+
],
|
|
74
|
+
"newlines-between": "always",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
"max-lines": [
|
|
78
|
+
"warn",
|
|
79
|
+
{ max: 160, skipBlankLines: true, skipComments: false },
|
|
80
|
+
],
|
|
81
|
+
quotes: ["error", "double"],
|
|
82
|
+
"react/display-name": "off",
|
|
83
|
+
"react/no-unescaped-entities": "off",
|
|
84
|
+
"react/prop-types": "off",
|
|
85
|
+
"react/react-in-jsx-scope": "off",
|
|
86
|
+
semi: ["error", "never"],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rpcbase/eslint-config",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./eslint.config.js",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"registry": "https://registry.npmjs.org/"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
+
"release": "wireit"
|
|
14
|
+
},
|
|
15
|
+
"wireit": {
|
|
16
|
+
"release": {
|
|
17
|
+
"command": "npm publish --verbose --tag $NPM_RELEASE_CHANNEL | tee publish-output.txt; exit_code=$?; test $exit_code -eq 0",
|
|
18
|
+
"dependencies": [],
|
|
19
|
+
"files": [
|
|
20
|
+
"package.json"
|
|
21
|
+
],
|
|
22
|
+
"output": [
|
|
23
|
+
"publish-output.txt"
|
|
24
|
+
],
|
|
25
|
+
"env": {
|
|
26
|
+
"NPM_RELEASE_CHANNEL": {
|
|
27
|
+
"external": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"eslint": "^9"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@eslint/js": "9.19.0",
|
|
37
|
+
"eslint-config-flat-gitignore": "2.0.0",
|
|
38
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
39
|
+
"eslint-plugin-import": "2.31.0",
|
|
40
|
+
"eslint-plugin-react": "7.37.4",
|
|
41
|
+
"globals": "15.14.0",
|
|
42
|
+
"typescript-eslint": "8.23.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/eslint": "9.6.1",
|
|
46
|
+
"typescript": "^5.x",
|
|
47
|
+
"eslint": "^9.x"
|
|
48
|
+
}
|
|
49
|
+
}
|