@rpcbase/eslint-config 0.19.0 → 0.21.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 +18 -3
- package/package.json +1 -1
- package/src/rules/no-lone-text-node.ts +2 -2
package/eslint.config.js
CHANGED
|
@@ -6,6 +6,8 @@ import pluginReact from "eslint-plugin-react"
|
|
|
6
6
|
import tseslint from "typescript-eslint"
|
|
7
7
|
import reactRefresh from "eslint-plugin-react-refresh"
|
|
8
8
|
|
|
9
|
+
import noLoneTextNode from "./src/rules/no-lone-text-node"
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
/** @type {import('eslint').Linter.Config[]} */
|
|
11
13
|
export const config = [
|
|
@@ -48,6 +50,7 @@ export const config = [
|
|
|
48
50
|
caughtErrors: "none",
|
|
49
51
|
},
|
|
50
52
|
],
|
|
53
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
51
54
|
"import/newline-after-import": ["error", { count: 2 }],
|
|
52
55
|
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/order.md
|
|
53
56
|
"import/order": [
|
|
@@ -83,14 +86,26 @@ export const config = [
|
|
|
83
86
|
],
|
|
84
87
|
"max-lines": [
|
|
85
88
|
"warn",
|
|
86
|
-
{ max:
|
|
89
|
+
{ max: 300, skipBlankLines: true, skipComments: false },
|
|
87
90
|
],
|
|
88
|
-
quotes: ["error", "double"],
|
|
91
|
+
"quotes": ["error", "double"],
|
|
89
92
|
"react/display-name": "off",
|
|
90
93
|
"react/no-unescaped-entities": "off",
|
|
91
94
|
"react/prop-types": "off",
|
|
92
95
|
"react/react-in-jsx-scope": "off",
|
|
93
|
-
semi: ["error", "never"],
|
|
96
|
+
"semi": ["error", "never"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
plugins: {
|
|
101
|
+
rb: {
|
|
102
|
+
rules: {
|
|
103
|
+
...noLoneTextNode,
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
rules: {
|
|
108
|
+
"rb/no-lone-text-node": "error",
|
|
94
109
|
},
|
|
95
110
|
},
|
|
96
111
|
];
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ const createRule = ESLintUtils.RuleCreator(
|
|
|
20
20
|
name => `@rpcbase/eslint-config/rules/${name}`
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
-
const defaultIgnoredChars = ["*", ":", "·", "•", "—", "–", "…", "-", "+", "(", ")", "\"", "\'"]
|
|
23
|
+
const defaultIgnoredChars = ["©", "*", ":", ".", "·", "•", "—", "–", "…", "-", "+", "(", ")", "\"", "\'"]
|
|
24
24
|
|
|
25
25
|
function isIgnoredText(text: string, ignored: string[]) {
|
|
26
26
|
// ignore if every non-whitespace char is in the list
|
|
@@ -47,7 +47,7 @@ function isMeaningful(child: TSESTree.JSXChild, ignored: string[]): boolean {
|
|
|
47
47
|
return true
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export
|
|
50
|
+
export default {
|
|
51
51
|
"no-lone-text-node": createRule<Options, MessageIds>({
|
|
52
52
|
name: "no-lone-text-node",
|
|
53
53
|
meta: {
|