@rpcbase/eslint-config 0.23.0 → 0.25.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 +34 -5
- package/package.json +4 -2
- package/src/rules/no-lone-text-node.ts +2 -1
package/eslint.config.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import gitignore from "eslint-config-flat-gitignore"
|
|
2
2
|
import globals from "globals"
|
|
3
|
-
import
|
|
3
|
+
import tseslint from "typescript-eslint"
|
|
4
4
|
import pluginJs from "@eslint/js"
|
|
5
|
+
// plugins
|
|
6
|
+
import pluginImport from "eslint-plugin-import"
|
|
5
7
|
import pluginReact from "eslint-plugin-react"
|
|
6
|
-
import tseslint from "typescript-eslint"
|
|
7
8
|
import reactRefresh from "eslint-plugin-react-refresh"
|
|
9
|
+
import pluginPlaywright from "eslint-plugin-playwright"
|
|
10
|
+
import pluginVitest from "@vitest/eslint-plugin"
|
|
11
|
+
import pluginReactHooks from "eslint-plugin-react-hooks"
|
|
8
12
|
|
|
9
13
|
import noLoneTextNode from "./src/rules/no-lone-text-node"
|
|
10
14
|
|
|
11
15
|
|
|
12
|
-
/** @type {import(
|
|
16
|
+
/** @type {import("eslint").Linter.Config[]} */
|
|
13
17
|
export const config = [
|
|
14
18
|
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
|
15
19
|
gitignore(),
|
|
@@ -30,7 +34,7 @@ export const config = [
|
|
|
30
34
|
...pluginReact.configs.flat.recommended,
|
|
31
35
|
settings: {
|
|
32
36
|
react: {
|
|
33
|
-
version: "
|
|
37
|
+
version: "19",
|
|
34
38
|
},
|
|
35
39
|
"import/resolver": {
|
|
36
40
|
typescript: {
|
|
@@ -108,4 +112,29 @@ export const config = [
|
|
|
108
112
|
"rb/no-lone-text-node": "error",
|
|
109
113
|
},
|
|
110
114
|
},
|
|
111
|
-
|
|
115
|
+
{
|
|
116
|
+
files: ["**/*.test.{js,mjs,cjs,ts,jsx,tsx}"],
|
|
117
|
+
plugins: {
|
|
118
|
+
vitest: pluginVitest,
|
|
119
|
+
},
|
|
120
|
+
rules: {
|
|
121
|
+
...pluginVitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules
|
|
122
|
+
"vitest/no-commented-out-tests": "off",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
...pluginPlaywright.configs["flat/recommended"],
|
|
127
|
+
files: ["spec/**"],
|
|
128
|
+
rules: {
|
|
129
|
+
...pluginPlaywright.configs["flat/recommended"].rules,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
files: ["**/*.{js,ts,tsx}"],
|
|
134
|
+
plugins: { "react-hooks": pluginReactHooks },
|
|
135
|
+
rules: {
|
|
136
|
+
"react-hooks/rules-of-hooks": "error",
|
|
137
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,17 +35,19 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@eslint/js": "9.26.0",
|
|
37
37
|
"@typescript-eslint/experimental-utils": "5.62.0",
|
|
38
|
+
"@vitest/eslint-plugin": "1.3.3",
|
|
38
39
|
"eslint-config-flat-gitignore": "2.1.0",
|
|
39
40
|
"eslint-import-resolver-typescript": "4.3.4",
|
|
40
41
|
"eslint-plugin-import": "2.31.0",
|
|
42
|
+
"eslint-plugin-playwright": "2.2.0",
|
|
41
43
|
"eslint-plugin-react": "7.37.5",
|
|
44
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
42
45
|
"eslint-plugin-react-refresh": "0.4.20",
|
|
43
46
|
"globals": "16.2.0",
|
|
44
47
|
"typescript-eslint": "8.35.0"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"@types/eslint": "9.6.1",
|
|
48
|
-
"eslint": "^9.x",
|
|
49
51
|
"typescript": "^5.x"
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TSESTree, ESLintUtils } from "@typescript-eslint/experimental-utils"
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
type MessageIds = "loneText"
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -20,7 +21,7 @@ const createRule = ESLintUtils.RuleCreator(
|
|
|
20
21
|
name => `@rpcbase/eslint-config/rules/${name}`
|
|
21
22
|
)
|
|
22
23
|
|
|
23
|
-
const defaultIgnoredChars = ["©", "*", ":", ".", "·", "•", "—", "–", "…", "-", "+", "(", ")", "\"", "
|
|
24
|
+
const defaultIgnoredChars = ["©", "*", ":", ".", "·", "•", "—", "–", "…", "-", "+", "(", ")", "\"", "'"]
|
|
24
25
|
|
|
25
26
|
function isIgnoredText(text: string, ignored: string[]) {
|
|
26
27
|
// ignore if every non-whitespace char is in the list
|