@forthtilliath/eslint-config 0.4.1 → 0.4.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 +10 -7
- package/dist/react-native.d.ts.map +1 -1
- package/dist/react-native.js +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,13 +111,16 @@ export default createBaseConfig({ strict: false, turbo: false });
|
|
|
111
111
|
Options are forwarded down the chain, so `createNextJsConfig({ prettier: false })`
|
|
112
112
|
also disables Prettier in the `reactConfig`/`baseConfig` layers it builds on.
|
|
113
113
|
|
|
114
|
-
`createReactNativeConfig` also always adds `eslint-plugin-react-native`
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`no-inline-styles
|
|
118
|
-
`no-unused-styles
|
|
119
|
-
`
|
|
120
|
-
|
|
114
|
+
`createReactNativeConfig` also always adds `eslint-plugin-react-native`'s
|
|
115
|
+
`no-raw-text` rule and the RN/Metro-injected `__DEV__` global — these aren't
|
|
116
|
+
behind an option, unlike the toggles above. Every other rule of the plugin
|
|
117
|
+
stays off: `no-inline-styles`/`sort-styles` are stylistic rather than
|
|
118
|
+
correctness checks, and `no-unused-styles`, `no-single-element-style-arrays`,
|
|
119
|
+
`split-platform-components`, and `no-color-literals` all crash outright under
|
|
120
|
+
ESLint 10 — `eslint-plugin-react-native@5.0.0` still calls
|
|
121
|
+
`context.getSourceCode()`/`context.getFilename()`, APIs ESLint 10 removed.
|
|
122
|
+
`no-raw-text` is the only one that doesn't. Re-enable the others once the
|
|
123
|
+
plugin ships a fix.
|
|
121
124
|
|
|
122
125
|
```ts
|
|
123
126
|
// Full i18n project (next-intl, react-intl...): forbid hardcoded JSX strings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;;;;iDAIiD;AACjD,+DAFW,OAAO,WAAW,EAAE,iBAAiB,GAAG,OAAO,YAAY,EAAE,kBAAkB,GAC7E,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;;;;iDAIiD;AACjD,+DAFW,OAAO,WAAW,EAAE,iBAAiB,GAAG,OAAO,YAAY,EAAE,kBAAkB,GAC7E,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAwC5C;AAED;;;;;8CAK8C;AAC9C,gCADU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CACiB"}
|
package/dist/react-native.js
CHANGED
|
@@ -29,21 +29,25 @@ export function createReactNativeConfig({ a11y = false, ...options } = {}) {
|
|
|
29
29
|
"react-native": pluginReactNative,
|
|
30
30
|
},
|
|
31
31
|
rules: {
|
|
32
|
-
|
|
32
|
+
// The only rule of the plugin that doesn't crash under ESLint 10 (see
|
|
33
|
+
// below) — real, useful signal (raw text outside a <Text>).
|
|
33
34
|
"react-native/no-raw-text": "error",
|
|
34
|
-
// Off by default:
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// keeps readable.
|
|
35
|
+
// Off by default: stylistic preference rather than a correctness
|
|
36
|
+
// check, and a common, legitimate RN pattern (one-off layout tweaks)
|
|
37
|
+
// that Prettier already keeps readable.
|
|
38
38
|
"react-native/no-inline-styles": "off",
|
|
39
|
-
// Off: crashes outright under ESLint 10
|
|
40
|
-
// not a function") —
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
39
|
+
// Off: every other rule crashes outright under ESLint 10
|
|
40
|
+
// ("context.getSourceCode/getFilename is not a function") —
|
|
41
|
+
// eslint-plugin-react-native@5.0.0 still calls APIs ESLint 10
|
|
42
|
+
// removed, either directly (sort-styles,
|
|
43
|
+
// no-single-element-style-arrays, split-platform-components) or via
|
|
44
|
+
// the util shared with no-unused-styles/no-color-literals. Re-enable
|
|
45
|
+
// each once the plugin ships a fix.
|
|
44
46
|
"react-native/no-unused-styles": "off",
|
|
45
47
|
"react-native/no-single-element-style-arrays": "off",
|
|
46
48
|
"react-native/sort-styles": "off",
|
|
49
|
+
"react-native/split-platform-components": "off",
|
|
50
|
+
"react-native/no-color-literals": "off",
|
|
47
51
|
},
|
|
48
52
|
},
|
|
49
53
|
]);
|