@hypersolid-dev/eslint-config 3.0.0 → 4.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/CHANGELOG.md +10 -0
- package/dist/react-native.js +32 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [4.0.0](https://dev.azure.com/wearetriple/Triple%20-%20Webteam/_git/eslint-config-hypersolid/branchCompare?baseVersion=GTv3.0.0&targetVersion=GTv4.0.0) (2026-11-09)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* **react-native:** the react-native preset enables three new error-level rules.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **react-native:** add Expo rules and Metro asset requires ([059b8c1](https://dev.azure.com/wearetriple/Triple%20-%20Webteam/_git/eslint-config-hypersolid/commit/059b8c1cd8d9bf3772da3b24fc3ed4a91078857a)), closes [AB#5178](https://dev.azure.com/wearetriple/Triple%20-%20Webteam/_workitems/edit/5178)
|
|
10
|
+
|
|
1
11
|
## [3.0.0](https://dev.azure.com/wearetriple/Triple%20-%20Webteam/_git/eslint-config-hypersolid/branchCompare?baseVersion=GTv2.0.0&targetVersion=GTv3.0.0) (2026-11-09)
|
|
2
12
|
|
|
3
13
|
### ⚠ BREAKING CHANGES
|
package/dist/react-native.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import expo from 'eslint-plugin-expo';
|
|
2
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
3
|
+
import { createNodeResolver } from 'eslint-plugin-import-x';
|
|
1
4
|
import globals from 'globals';
|
|
2
5
|
import noSecrets from 'eslint-plugin-no-secrets';
|
|
3
6
|
import reactNativeA11y from './plugins/react-native-a11y/index.js';
|
|
@@ -18,6 +21,14 @@ const NO_SECRETS_IGNORE = [
|
|
|
18
21
|
'^[A-Z][A-Za-z0-9]*\\/[A-Z][A-Za-z0-9]*$', // i18n `Namespace/Key` paths
|
|
19
22
|
'^data:', // Lottie and embedded images
|
|
20
23
|
];
|
|
24
|
+
// Metro picks `Button.ios.tsx` for `./Button` on iOS; the resolvers must try the same platform files, or
|
|
25
|
+
// `import-x/no-unresolved` flags every platform-split module. Platform files first, as Metro resolves them.
|
|
26
|
+
const RESOLVE_EXTENSIONS = ['.ios', '.android', '.native', '.web', ''].flatMap((platform) => ['.ts', '.tsx', '.d.ts', '.js', '.jsx', '.mjs', '.cjs', '.json'].map((extension) => `${platform}${extension}`));
|
|
27
|
+
// Metro's default asset extensions plus Expo's additions, and json (source or asset); from eslint-config-expo.
|
|
28
|
+
const METRO_ASSET_EXTENSIONS = [
|
|
29
|
+
'aac', 'aiff', 'avif', 'bmp', 'caf', 'db', 'gif', 'heic', 'html', 'jpeg', 'jpg', 'json', 'm4a', 'm4v', 'mov', 'mp3',
|
|
30
|
+
'mp4', 'mpeg', 'mpg', 'otf', 'pdf', 'png', 'psd', 'svg', 'ttf', 'wav', 'webm', 'webp', 'xml', 'yaml', 'yml', 'zip',
|
|
31
|
+
];
|
|
21
32
|
export default function reactNative() {
|
|
22
33
|
return raiseWarnings([
|
|
23
34
|
{
|
|
@@ -28,8 +39,28 @@ export default function reactNative() {
|
|
|
28
39
|
{
|
|
29
40
|
name: '@hypersolid-dev/react-native',
|
|
30
41
|
files: CODE_FILES,
|
|
31
|
-
|
|
42
|
+
// eslint-plugin-expo is typed with typescript-eslint's RuleModule, which ESLint's Plugin type does not accept.
|
|
43
|
+
plugins: { expo: expo, 'no-secrets': noSecrets },
|
|
44
|
+
settings: {
|
|
45
|
+
'import-x/resolver-next': [
|
|
46
|
+
createTypeScriptImportResolver({ extensions: RESOLVE_EXTENSIONS }),
|
|
47
|
+
createNodeResolver({ extensions: RESOLVE_EXTENSIONS }),
|
|
48
|
+
],
|
|
49
|
+
},
|
|
32
50
|
rules: {
|
|
51
|
+
// Babel only inlines an `EXPO_PUBLIC_` env var read by its static name. Bad: `process.env[key]`.
|
|
52
|
+
'expo/no-dynamic-env-var': 'error',
|
|
53
|
+
// Destructured env vars are not inlined and are `undefined` at runtime. Bad: `const { EXPO_PUBLIC_API } = process.env`.
|
|
54
|
+
'expo/no-env-var-destructuring': 'error',
|
|
55
|
+
// A `'use dom'` file must default-export one component. Bad: `'use dom'; export const Chart = () => …`.
|
|
56
|
+
'expo/use-dom-exports': 'error',
|
|
57
|
+
// `require` is only for Metro assets, matching what Metro bundles. Bad: `const utils = require('./utils')`.
|
|
58
|
+
'@typescript-eslint/no-require-imports': [
|
|
59
|
+
'error',
|
|
60
|
+
{
|
|
61
|
+
allow: [String.raw `\.(${METRO_ASSET_EXTENSIONS.join('|')})$`],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
33
64
|
// Browser globals React Native lacks, and the coercing number globals. Bad: `document.title`, `isNaN(value)`.
|
|
34
65
|
'no-restricted-globals': [
|
|
35
66
|
'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypersolid-dev/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Shared ESLint flat config for Hypersolid TypeScript projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"@typescript-eslint/types": "^8.72.1",
|
|
74
74
|
"@typescript-eslint/utils": "^8.72.1",
|
|
75
75
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
76
|
+
"eslint-plugin-expo": "^1.2.1",
|
|
76
77
|
"eslint-plugin-import-x": "^4.17.1",
|
|
77
78
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
78
79
|
"eslint-plugin-no-secrets": "^2.3.3",
|