@forthtilliath/eslint-config 0.4.0 → 0.4.1
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 +5 -3
- package/dist/react-native.d.ts.map +1 -1
- package/dist/react-native.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,10 +112,12 @@ 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
114
|
`createReactNativeConfig` also always adds `eslint-plugin-react-native`
|
|
115
|
-
(`
|
|
116
|
-
`split-platform-components`, `no-raw-text`; `no-inline-styles` and
|
|
117
|
-
`sort-styles` stay off — stylistic, not correctness) and the RN/Metro-injected
|
|
115
|
+
(`split-platform-components`, `no-raw-text`) and the RN/Metro-injected
|
|
118
116
|
`__DEV__` global — these aren't behind an option, unlike the toggles above.
|
|
117
|
+
`no-inline-styles` and `sort-styles` stay off (stylistic, not correctness);
|
|
118
|
+
`no-unused-styles` and `no-single-element-style-arrays` also stay off —
|
|
119
|
+
`eslint-plugin-react-native@5.0.0` crashes running them under ESLint 10
|
|
120
|
+
(`context.getSourceCode is not a function`, an API ESLint 10 removed).
|
|
119
121
|
|
|
120
122
|
```ts
|
|
121
123
|
// 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,CAoC5C;AAED;;;;;8CAK8C;AAC9C,gCADU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CACiB"}
|
package/dist/react-native.js
CHANGED
|
@@ -29,8 +29,6 @@ export function createReactNativeConfig({ a11y = false, ...options } = {}) {
|
|
|
29
29
|
"react-native": pluginReactNative,
|
|
30
30
|
},
|
|
31
31
|
rules: {
|
|
32
|
-
"react-native/no-unused-styles": "error",
|
|
33
|
-
"react-native/no-single-element-style-arrays": "error",
|
|
34
32
|
"react-native/split-platform-components": "error",
|
|
35
33
|
"react-native/no-raw-text": "error",
|
|
36
34
|
// Off by default: both are stylistic preferences rather than
|
|
@@ -38,6 +36,13 @@ export function createReactNativeConfig({ a11y = false, ...options } = {}) {
|
|
|
38
36
|
// legitimate RN pattern (one-off layout tweaks) that Prettier already
|
|
39
37
|
// keeps readable.
|
|
40
38
|
"react-native/no-inline-styles": "off",
|
|
39
|
+
// Off: crashes outright under ESLint 10 ("context.getSourceCode is
|
|
40
|
+
// not a function") — eslint-plugin-react-native@5.0.0 still calls the
|
|
41
|
+
// API ESLint 10 removed, in the util shared by no-unused-styles/
|
|
42
|
+
// no-color-literals and in sort-styles/no-single-element-style-arrays
|
|
43
|
+
// directly. Re-enable once the plugin ships a fix.
|
|
44
|
+
"react-native/no-unused-styles": "off",
|
|
45
|
+
"react-native/no-single-element-style-arrays": "off",
|
|
41
46
|
"react-native/sort-styles": "off",
|
|
42
47
|
},
|
|
43
48
|
},
|