@webority/biome-config 0.149.0 → 0.152.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/README.md +85 -47
- package/biome.jsonc +74 -3
- package/biome.phone.jsonc +20 -0
- package/package.json +12 -4
- package/plugins/form-needs-no-validate.grit +14 -0
- package/plugins/no-fixed-key-reflect-get.grit +14 -0
- package/plugins/no-locale-in-screen.grit +14 -0
- package/plugins/no-raw-form.grit +16 -0
- package/plugins/no-store-checks-off.grit +10 -0
- package/plugins/no-whole-slice-selector.grit +15 -0
- package/plugins/web-grit-empty-catch.grit +27 -3
- package/plugins/web-grit-raw-query-read.grit +21 -0
- package/plugins/web-grit-route-lazy-reload.grit +18 -0
- package/tsconfig/node.json +25 -0
- package/tsconfig/phone.json +26 -0
- package/tsconfig/razor.json +24 -0
- package/tsconfig/web.json +25 -0
package/README.md
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
# @webority/biome-config
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
products. Extend it from a product's `biome.json` so every repo inherits the same
|
|
5
|
-
shared ruleset — and a policy change is one version bump, not an N-way copy that
|
|
6
|
-
drifts. Same model as the shared `@webority/theme` + `@webority/ui-react`.
|
|
3
|
+
The single source of truth for Webority code standards across frontend products: the Biome lint and format policy, and the TypeScript compiler presets for web apps, phone apps, Razor page scripts and Node packages. A product extends these files instead of keeping its own copy, so a policy change is one version bump and not an N-way copy that drifts. Same model as the shared `@webority/theme` and `@webority/ui-react`.
|
|
7
4
|
|
|
8
|
-
##
|
|
5
|
+
## Biome
|
|
9
6
|
|
|
10
7
|
```bash
|
|
11
8
|
npm install -D --save-exact @webority/biome-config
|
|
12
9
|
npm install -D @biomejs/biome
|
|
13
10
|
```
|
|
14
11
|
|
|
15
|
-
`--save-exact` is deliberate
|
|
16
|
-
policy change arrives when you bump it rather than on someone's next `npm install`.
|
|
12
|
+
`--save-exact` is deliberate: pin `@webority/*` to an exact version, never `^`, so a policy change arrives when you bump it rather than on someone's next `npm install`.
|
|
17
13
|
|
|
18
|
-
Then a product's `biome.json` extends this base and adds **only** its own repo-specific
|
|
19
|
-
bits — `vcs.root` and `files.includes`:
|
|
14
|
+
Then a product's `biome.json` extends this base and adds **only** its own repo-specific bits, `vcs.root` and `files.includes`:
|
|
20
15
|
|
|
21
16
|
```jsonc
|
|
22
17
|
{
|
|
23
|
-
"$schema": "https://biomejs.dev/schemas/2.6.
|
|
18
|
+
"$schema": "https://biomejs.dev/schemas/2.6.5/schema.json",
|
|
24
19
|
"extends": ["@webority/biome-config/biome.jsonc"],
|
|
25
20
|
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true, "root": ".." },
|
|
26
21
|
"files": {
|
|
@@ -30,32 +25,75 @@ bits — `vcs.root` and `files.includes`:
|
|
|
30
25
|
}
|
|
31
26
|
```
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(`end_of_line = lf`). This config sets `useEditorconfig: false`, so the value above is the
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **Format:** 4-space, width 140, double quotes, semicolons, trailing commas, **LF line
|
|
43
|
-
endings** (`useEditorconfig: false`, so this file is the sole authority — see above).
|
|
44
|
-
- **`useExhaustiveDependencies: error`**: a missing hook dependency is a stale-closure bug
|
|
45
|
-
that builds clean. A deliberate trigger-only or run-once effect carries
|
|
46
|
-
`// biome-ignore lint/correctness/useExhaustiveDependencies: <reason>` on that hook. A repo
|
|
47
|
-
adopting this version records its existing violations once with
|
|
48
|
-
`biome lint --only=correctness/useExhaustiveDependencies --suppress --reason="<why>"`, so
|
|
49
|
-
every new violation still fails.
|
|
28
|
+
A phone app (React Native or Expo) also extends `biome.phone.jsonc`, after the base: `"extends": ["@webority/biome-config/biome.jsonc", "@webority/biome-config/biome.phone.jsonc"]`. It sets `noReactNativeRawText` to `error`, with a `skip` list of the mobile-ui components that draw their string children inside `Text` (`Markdown`, `SectionHeader`). Raw text in any other element still fails. A new mobile-ui component that renders its children as text joins the list in `biome.phone.jsonc`. A web app never extends it, because the rule reads React Native's text model.
|
|
29
|
+
|
|
30
|
+
**Never set `formatter.lineEnding` in a product.** It is `lf` here, for every consuming repo, matching their `.gitattributes` (`* text=auto eol=lf`) and `.editorconfig` (`end_of_line = lf`). This config sets `useEditorconfig: false`, so the value above is the *only* place the line ending is stated. A local override is the deviation, and a stale one fails every file in the repo at once, drowning any real violation (one repo's leftover `"lineEnding": "crlf"` failed 198 of its 203 files; removing it left 1).
|
|
31
|
+
|
|
32
|
+
## What Biome decides here (once, for every repo)
|
|
33
|
+
|
|
34
|
+
- **Format:** 4-space, width 140, double quotes, semicolons, trailing commas, **LF line endings** (`useEditorconfig: false`, so this file is the sole authority).
|
|
35
|
+
- **`useExhaustiveDependencies: error`**: a missing hook dependency is a stale-closure bug that builds clean. A deliberate trigger-only or run-once effect carries `// biome-ignore lint/correctness/useExhaustiveDependencies: <reason>` on that hook. A repo adopting this version records its existing violations once with `biome lint --only=correctness/useExhaustiveDependencies --suppress --reason="<why>"`, so every new violation still fails.
|
|
36
|
+
- **`noDangerouslySetInnerHtml: error`** (security): raw HTML injection skips escaping. Render through a component; a repo-owned SVG drawn inline takes a per-line `biome-ignore` that cites its EX entry in `.webority/baselines/exceptions.json`, as the react-sandbox foundation pages do (EX-3).
|
|
50
37
|
- **`a11y` group: off**, because accessibility is a practice and not hygiene. A product turns it on with a second entry in `extends`, `@webority/biome-config/a11y.jsonc`, which sets the group to `error`. See "Accessibility checks (opt-in)".
|
|
51
38
|
- **Stricter rules, all `error`**: `noUnusedImports`, `noUnusedFunctionParameters` (prefix an interface-required parameter with `_`), `useOptionalChain`, `noUselessFragments`, `useTemplate`, `useIterableCallbackReturn`, `noGlobalIsNan`, `noAssignInExpressions`. Each is recorded with its reason in `biome.jsonc`.
|
|
52
|
-
- **`noArrayIndexKey` and `noDuplicateProperties`: `error
|
|
53
|
-
|
|
54
|
-
- **`noConsole`** off for `scripts/**`
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
-
|
|
39
|
+
- **`noArrayIndexKey` and `noDuplicateProperties`: `error`**, kept on because they catch real dynamic-list bugs; genuine static-list exceptions get a documented per-line `biome-ignore`.
|
|
40
|
+
- **`noFloatingPromises: error`** (nursery): see "Type-reading rules" below.
|
|
41
|
+
- **`noConsole`** off for `scripts/**` and `logger.js`; CSS and SCSS not linted; the icon module's mixed export allowed.
|
|
42
|
+
- **`StyleSheet.absoluteFillObject`** is an error, through the `no-absolute-fill-object` plugin (below).
|
|
43
|
+
- **Twenty-one GritQL plugins** (`mobile-grit-*`, `web-grit-*`, `no-absolute-fill-object`, `no-raw-form`, `no-locale-in-screen`, `no-store-checks-off`, `no-whole-slice-selector`, `form-needs-no-validate` and `no-fixed-key-reflect-get`, below) are errors.
|
|
44
|
+
- `**/razor-js/*.ts`: classic page scripts keep `"use strict"`, function declarations and string concatenation; four module-only rules are off.
|
|
45
|
+
- `**/*.md`: Markdown is neither formatted nor linted, because Biome rewrites bare glob paths and a lint fix under `check --write` would rewrite a changelog's released sections.
|
|
46
|
+
|
|
47
|
+
## TypeScript presets
|
|
48
|
+
|
|
49
|
+
Four presets live in `tsconfig/`. Each holds the shared compiler options, so a project extends one file and does not copy it. A project's own `tsconfig.json` states only what differs: its `include`, `paths`, `rootDir`, and `types` where the preset's `types` does not fit.
|
|
50
|
+
|
|
51
|
+
Every preset sets `target` ES2022, `strict`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `noImplicitOverride`, `noImplicitReturns`, `noFallthroughCasesInSwitch`, `noUnusedLocals`, `noUnusedParameters`, `noUncheckedSideEffectImports`, `erasableSyntaxOnly`, `verbatimModuleSyntax`, `isolatedModules`, `forceConsistentCasingInFileNames`, `resolveJsonModule`, `skipLibCheck` and `noEmit`. Each build emits through its own tool (Vite, bob, tsc for declarations), so the presets only type-check.
|
|
52
|
+
|
|
53
|
+
### web
|
|
54
|
+
|
|
55
|
+
For a React web app or portal. The browser libraries DOM and DOM.Iterable are in, JSX is `react-jsx`, and modules resolve with `bundler`.
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{ "extends": "@webority/biome-config/tsconfig/web.json" }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### phone
|
|
62
|
+
|
|
63
|
+
For a React Native or Expo app. No DOM library, because a phone runtime has none. JSX is `react-jsx`, and `types` is `["jest"]`, the test runner the phone packages already use. A phone app that runs another runner sets its own `types`.
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{ "extends": "@webority/biome-config/tsconfig/phone.json" }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### razor
|
|
70
|
+
|
|
71
|
+
For the script of a Razor Pages site, which runs in the browser. DOM and DOM.Iterable are in, and there is no JSX.
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{ "extends": "@webority/biome-config/tsconfig/razor.json" }
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### node
|
|
78
|
+
|
|
79
|
+
For a Node package or script. No DOM and no JSX. Modules and resolution are `NodeNext`, and `types` is `["node"]`.
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{ "extends": "@webority/biome-config/tsconfig/node.json" }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Type-reading rules
|
|
86
|
+
|
|
87
|
+
Biome reads the types of the code it lints, so a rule can flag a promise the compiler accepts. The cases below were checked against Biome 2.6.5 with a probe file of each case; they are the cases the rules catch and miss at that version.
|
|
88
|
+
|
|
89
|
+
| Rule | Status | Caught | Missed |
|
|
90
|
+
|---|---|---|---|
|
|
91
|
+
| `noFloatingPromises` | `error` in `biome.jsonc` | A bare call of an async function; a method returning a Promise on an object literal, a class instance or an imported class; a call through a type alias; a `.then` chain with no catch; a call that is the body of an `if` branch. | A promise inside an array literal (`[make()]`); a promise assigned to an `unknown` variable; a call on a receiver typed `any`. |
|
|
92
|
+
| `noMisusedPromises` | not in this preset yet | An async callback passed to `forEach`; a promise used as an `if` condition. | An async function assigned to a `() => void` property of an object literal, which is how a React `onClick` prop is passed. An async function assigned to a `void` variable. TypeScript accepts both too. |
|
|
93
|
+
|
|
94
|
+
The fix for a flagged floating promise is to await it, handle its rejection, or mark it `void` when nothing waits on it: `void` keeps a rejection unhandled, so it still reaches the page's unhandled-rejection reporting.
|
|
95
|
+
|
|
96
|
+
Because `noMisusedPromises` misses the React prop shape, an async handler passed as a prop needs review by hand until a rule covers it.
|
|
59
97
|
|
|
60
98
|
## Plugins (GritQL)
|
|
61
99
|
|
|
@@ -64,6 +102,12 @@ The config ships lint plugins in `plugins/` and turns them on for every product
|
|
|
64
102
|
| Plugin | Fails on | Why |
|
|
65
103
|
|---|---|---|
|
|
66
104
|
| `no-absolute-fill-object` | `StyleSheet.absoluteFillObject` | React Native 0.86 removed it. It is `undefined`, and spreading it silently leaves the view in the layout flow. Use `StyleSheet.absoluteFill` (spread it or use it directly). |
|
|
105
|
+
| `no-raw-form` | A JSX `<form>` element in any file other than `AppForm.tsx` | A raw form lets a double click submit twice and sends no idempotency key. Use `AppForm` from `@webority/ui-react`. |
|
|
106
|
+
| `no-locale-in-screen` | A `toLocale*()` call, or an `Intl.*` / `new Intl.*` call, in a file under a `screens/` folder (tests exempt), for example `d.toLocaleDateString("en-IN")` | A screen formats through the shared formatters: `formatDate`, `formatDateTime`, `formatNumber`, `formatINR` from `@webority/web-core` (`@webority/mobile-core` on phone). |
|
|
107
|
+
| `no-store-checks-off` | `serializableCheck: false` or `immutableCheck: false` | The store's checks catch a non-plain value or a mutation in development. Exclude only named `ignoredActions` or `ignoredPaths`, each with a one-line reason. |
|
|
108
|
+
| `no-whole-slice-selector` | An inline function passed to `useSelector` or `useAppSelector`, or a destructured result, for example `const { token } = useSelector(selectAccount)` | A selector returns one primitive or one stored reference, so the component re-renders only when that value changes. Write `useSelector(selectX)` and export derived data as a memoized selector from the slice file. |
|
|
109
|
+
| `no-fixed-key-reflect-get` | `Reflect.get` with a fixed key (a string or a template with no `${}`) reads a field the type does not declare; read `obj.key`, or narrow with `'key' in obj` first. A computed key is not matched. | A fixed key is a field the type does not declare, read past the compiler. |
|
|
110
|
+
| `form-needs-no-validate` | A `form` or `AppForm` whose `onSubmit` goes through `handleSubmit` without `noValidate` | The browser's own validation would run beside the form library's. Set `noValidate`; any value passes. |
|
|
67
111
|
| `mobile-grit-alert-alert` | `Alert.alert` | A confirm or alert is the mobile-ui `Dialog`, and a short message is a `toast`. |
|
|
68
112
|
| `mobile-grit-touchable` | `TouchableOpacity`, `TouchableHighlight`, `TouchableWithoutFeedback` | Retired. Use a mobile-ui component, or `Pressable` with `accessibilityRole` and a label. |
|
|
69
113
|
| `mobile-grit-index-key` | an inline `keyExtractor={(item, index) => ...}` whose body uses `index` | A key from the index breaks row state on a reorder or an insert. Return the record's stable id. |
|
|
@@ -73,22 +117,17 @@ The config ships lint plugins in `plugins/` and turns them on for every product
|
|
|
73
117
|
| `mobile-grit-select-from-result` | an RTK Query `selectFromResult` that returns a non-object value, or that takes `refetch` | RTK Query spreads the result beside `refetch`, so a plain value replaces the hook result. Return `{ name: value }` and destructure; take `refetch` from the hook's own result. |
|
|
74
118
|
| `mobile-grit-keyboard-avoiding` | `KeyboardAvoidingView`, `Keyboard.addListener` | Keyboard handling is `react-native-keyboard-controller`: `KeyboardProvider`, `KeyboardAwareScrollView`, `KeyboardStickyView`. |
|
|
75
119
|
| `mobile-grit-keychain-internet` | `setInternetCredentials`, `getInternetCredentials`, `hasInternetCredentials` | A token is a generic password. Use `setGenericPassword`, `getGenericPassword` and `resetGenericPassword`. `resetInternetCredentials` stays allowed for the first-install clean-up. |
|
|
120
|
+
| `mobile-grit-unchecked-native-call` | A `NativeModules.<module>.<method>(...)` call, or a call on a default import from a `Native<Name>` module, whose result is dropped, voided, or caught by an empty handler, for example `void NativeModules.x.y()` | A failed native call goes unnoticed. Await it and handle the failure, or return it to a caller that does. |
|
|
76
121
|
| `web-grit-axios-module-config` | `axios.create({ baseURL: <non-literal> })` or `timeout: <non-literal>` outside a function | Config read at import time cannot be set later. Resolve it at call time in an interceptor. |
|
|
122
|
+
| `web-grit-empty-catch` | An empty `catch {}` block, or a promise `.catch(...)` whose handler is empty or returns only `null` or `undefined`, for example `.catch(() => {})` | The catch swallows the error. Handle it, retry it as a classified transient, or log it and rethrow it. A documented best-effort path says why in a `biome-ignore lint/plugin/web-grit-empty-catch` comment. |
|
|
123
|
+
| `web-grit-raw-query-read` | An RTK Query hook result read outside `useDataState`, for example `const { data } = useGetXQuery()` or `api.endpoints.x.useQuery()` | A screen reads a query only as a data state. Write `useDataState(useXQuery(args))` and draw it with AppAsyncBlock (AsyncBlock on phone). |
|
|
124
|
+
| `web-grit-route-lazy-reload` | A `lazy(...)` or `React.lazy(...)` call, or a route `lazy:` property, whose argument is `import(...)` without the reload helper, for example `lazy: () => import(...)` | A tab opened before a deploy breaks on its next navigation. Load a route with `lazy: importWithReload(() => import(...))`, or a component with `lazyWithReload(() => import(...))`, both from `@webority/web-core/router`. |
|
|
77
125
|
|
|
78
126
|
A plugin finding is an error, so `biome check` and `biome lint` fail on it.
|
|
79
127
|
|
|
80
|
-
**Your `biome.json` must sit beside the `node_modules` that holds `@webority/biome-config`.** Biome
|
|
81
|
-
resolves a plugin path against the folder of your own `biome.json`, not against this package, so the
|
|
82
|
-
config names its plugins as `./node_modules/@webority/biome-config/plugins/…`. That is the normal layout
|
|
83
|
-
for an app folder (`biome.json`, `package.json` and `node_modules` together). In any other layout Biome
|
|
84
|
-
stops with `Cannot read file` for the plugin on every run, so a wrong layout is never silent; a
|
|
85
|
-
workspace root that runs Biome adds `@webority/biome-config` to its own `devDependencies`. Needs
|
|
86
|
-
`@biomejs/biome` 2.5 or newer (checked on 2.5.15 and 2.6.4). The shared files carry no `$schema`, because
|
|
87
|
-
Biome refuses an extended config whose schema names a different Biome version; your own `biome.json` names
|
|
88
|
-
the schema of the Biome version you install.
|
|
128
|
+
**Your `biome.json` must sit beside the `node_modules` that holds `@webority/biome-config`.** Biome resolves a plugin path against the folder of your own `biome.json`, not against this package, so the config names its plugins as `./node_modules/@webority/biome-config/plugins/…`. That is the normal layout for an app folder (`biome.json`, `package.json` and `node_modules` together). In any other layout Biome stops with `Cannot read file` for the plugin on every run, so a wrong layout is never silent. A workspace root that runs Biome adds `@webority/biome-config` to its own `devDependencies`. Needs `@biomejs/biome` 2.6.5 or newer, the peer range in `package.json`, because older versions refuse rules this config sets. The shared files carry no `$schema`, because Biome refuses an extended config whose schema names a different Biome version; your own `biome.json` names the schema of the Biome version you install.
|
|
89
129
|
|
|
90
|
-
Product-specific one-offs (a bespoke file that co-exports,
|
|
91
|
-
`overrides` entry or a documented inline `biome-ignore` in that product.
|
|
130
|
+
Product-specific one-offs (a bespoke file that co-exports, for example) still use a local `overrides` entry or a documented inline `biome-ignore` in that product.
|
|
92
131
|
|
|
93
132
|
## Accessibility checks (opt-in)
|
|
94
133
|
|
|
@@ -104,5 +143,4 @@ An app that turns it on records each deliberate exception with an inline `biome-
|
|
|
104
143
|
|
|
105
144
|
## Versioning
|
|
106
145
|
|
|
107
|
-
Published from the `webority-ui` monorepo on each release, in lockstep with the other
|
|
108
|
-
`@webority/*` packages. Pin a version; bump to adopt policy changes deliberately.
|
|
146
|
+
Published from the `webority-ui` monorepo on each release, in lockstep with the other `@webority/*` packages. Pin a version; bump to adopt policy changes deliberately.
|
package/biome.jsonc
CHANGED
|
@@ -41,7 +41,14 @@
|
|
|
41
41
|
// mobile-grit-keychain-internet: set, get and has InternetCredentials for a token; the generic password API replaces them.
|
|
42
42
|
// web-grit-axios-module-config: axios.create reading baseURL or timeout from config at module scope; resolve at call time.
|
|
43
43
|
// web-grit-empty-catch: an empty catch block (a comment alone included) swallows the error.
|
|
44
|
+
// web-grit-raw-query-read: an RTK Query hook result read outside useDataState.
|
|
45
|
+
// web-grit-route-lazy-reload: a route's lazy or a React.lazy that loads a screen without the reload helper.
|
|
44
46
|
// mobile-grit-unchecked-native-call: a NativeModules or codegen spec call whose result is dropped, voided or swallowed.
|
|
47
|
+
// no-raw-form: a JSX form element outside AppForm.tsx; AppForm drops a double submit and carries an idempotency key.
|
|
48
|
+
// no-locale-in-screen: a toLocale* or Intl call in a screens/ file; the shared formatters format dates and numbers.
|
|
49
|
+
// no-store-checks-off: serializableCheck or immutableCheck set to false in a store.
|
|
50
|
+
// no-whole-slice-selector: an inline useSelector function, or a destructured useSelector result.
|
|
51
|
+
// form-needs-no-validate: a form or AppForm submitted through handleSubmit without noValidate.
|
|
45
52
|
"plugins": [
|
|
46
53
|
"./node_modules/@webority/biome-config/plugins/no-absolute-fill-object.grit",
|
|
47
54
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-alert-alert.grit",
|
|
@@ -55,7 +62,15 @@
|
|
|
55
62
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-keychain-internet.grit",
|
|
56
63
|
"./node_modules/@webority/biome-config/plugins/web-grit-axios-module-config.grit",
|
|
57
64
|
"./node_modules/@webority/biome-config/plugins/web-grit-empty-catch.grit",
|
|
58
|
-
"./node_modules/@webority/biome-config/plugins/
|
|
65
|
+
"./node_modules/@webority/biome-config/plugins/web-grit-raw-query-read.grit",
|
|
66
|
+
"./node_modules/@webority/biome-config/plugins/web-grit-route-lazy-reload.grit",
|
|
67
|
+
"./node_modules/@webority/biome-config/plugins/mobile-grit-unchecked-native-call.grit",
|
|
68
|
+
"./node_modules/@webority/biome-config/plugins/no-raw-form.grit",
|
|
69
|
+
"./node_modules/@webority/biome-config/plugins/no-locale-in-screen.grit",
|
|
70
|
+
"./node_modules/@webority/biome-config/plugins/no-store-checks-off.grit",
|
|
71
|
+
"./node_modules/@webority/biome-config/plugins/no-whole-slice-selector.grit",
|
|
72
|
+
"./node_modules/@webority/biome-config/plugins/no-fixed-key-reflect-get.grit",
|
|
73
|
+
"./node_modules/@webority/biome-config/plugins/form-needs-no-validate.grit"
|
|
59
74
|
],
|
|
60
75
|
"linter": {
|
|
61
76
|
"enabled": true,
|
|
@@ -91,15 +106,42 @@
|
|
|
91
106
|
"useExhaustiveDependencies": "error",
|
|
92
107
|
"useHookAtTopLevel": "error"
|
|
93
108
|
},
|
|
109
|
+
"security": {
|
|
110
|
+
// Raw HTML injection skips escaping; a repo-owned inline SVG takes a per-line biome-ignore citing its EX entry.
|
|
111
|
+
"noDangerouslySetInnerHtml": "error"
|
|
112
|
+
},
|
|
94
113
|
"nursery": {
|
|
95
114
|
// A promise nobody awaits loses its ordering and its error. Await it, handle it, or mark
|
|
96
115
|
// it with void when nothing waits on it: void keeps a rejection unhandled, so it still
|
|
97
116
|
// reaches the page's unhandled-rejection reporting.
|
|
98
117
|
"noFloatingPromises": "error",
|
|
118
|
+
// `+` on an object, symbol, unknown or a number and bigint prints "[object Object]" or throws.
|
|
119
|
+
"noUnsafePlusOperands": "error",
|
|
120
|
+
// A Disposable held without `using` is never disposed.
|
|
121
|
+
"useDisposables": "error",
|
|
99
122
|
// A switch over a union that misses a member is a silent fall-through to the default.
|
|
100
|
-
"useExhaustiveSwitchCases": "error"
|
|
123
|
+
"useExhaustiveSwitchCases": "error",
|
|
124
|
+
// A cast the type already satisfies is noise, and the next change of that type keeps it silently.
|
|
125
|
+
"noUselessTypeAssertion": "error",
|
|
126
|
+
// A cast to a type the value may not hold turns the compiler's check off at that line; narrow or parse instead.
|
|
127
|
+
"noUnsafeTypeAssertion": "error"
|
|
101
128
|
},
|
|
102
129
|
"style": {
|
|
130
|
+
// One HTTP client and one telemetry set-up per portal, both owned by web-core.
|
|
131
|
+
"noRestrictedImports": {
|
|
132
|
+
"level": "error",
|
|
133
|
+
"options": {
|
|
134
|
+
"paths": {
|
|
135
|
+
// The rule cannot tell a type import from a value import, so the four type names a service
|
|
136
|
+
// declares its client with are allowed by name; the default import and every helper stay banned.
|
|
137
|
+
"axios": {
|
|
138
|
+
"message": "Call the API through the shared client: userClient or publicClient from @webority/web-core/api (mobile apps: @webority/mobile-core), and read a failure with extractApiError. The shared client carries the token refresh, retry, trace header and error handling.",
|
|
139
|
+
"allowImportNames": ["AxiosInstance", "AxiosRequestConfig", "AxiosResponse", "AxiosError"]
|
|
140
|
+
},
|
|
141
|
+
"@microsoft/applicationinsights-web": "Send telemetry through the shared logger: call initAppInsights from @webority/web-core/appInsights once at startup, then log with Logger."
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
103
145
|
// A forced non-null hides the case the type says can happen.
|
|
104
146
|
"noNonNullAssertion": "error",
|
|
105
147
|
// Style rule with a safe fix.
|
|
@@ -134,6 +176,12 @@
|
|
|
134
176
|
"noDuplicateProperties": "error",
|
|
135
177
|
// An untyped value switches type checking off for everything it touches.
|
|
136
178
|
"noExplicitAny": "error",
|
|
179
|
+
// The two silent routes to the same `any`: a `let` with no type and no value, and a variable whose type grows by assignment.
|
|
180
|
+
"noImplicitAnyLet": "error",
|
|
181
|
+
"noEvolvingTypes": "error",
|
|
182
|
+
// `!!` and `a?.b!` assert away the very undefined the optional chain admits.
|
|
183
|
+
"noExtraNonNullAssertion": "error",
|
|
184
|
+
"noNonNullAssertedOptionalChain": "error",
|
|
137
185
|
// Apps log through the web-core Logger, and a library through its one diagnostics
|
|
138
186
|
// module (devWarn and devError). Any other console call fails lint.
|
|
139
187
|
"noConsole": "error"
|
|
@@ -166,7 +214,7 @@
|
|
|
166
214
|
"overrides": [
|
|
167
215
|
{
|
|
168
216
|
// Loggers + build/tooling scripts legitimately use console.
|
|
169
|
-
"includes": ["scripts/**", "**/logger.js"],
|
|
217
|
+
"includes": ["scripts/**", "**/logger.js", "**/logger.ts"],
|
|
170
218
|
"linter": {
|
|
171
219
|
"rules": {
|
|
172
220
|
"suspicious": {
|
|
@@ -193,6 +241,29 @@
|
|
|
193
241
|
"linter": {
|
|
194
242
|
"enabled": false
|
|
195
243
|
}
|
|
244
|
+
},
|
|
245
|
+
// A razor-js page script is a classic script, not a module: its "use strict" is live and its function declarations are page globals.
|
|
246
|
+
{
|
|
247
|
+
"includes": ["**/razor-js/*.ts"],
|
|
248
|
+
"linter": {
|
|
249
|
+
"rules": {
|
|
250
|
+
"suspicious": { "noRedundantUseStrict": "off" },
|
|
251
|
+
"complexity": { "useArrowFunction": "off" },
|
|
252
|
+
"correctness": { "noInnerDeclarations": "off" },
|
|
253
|
+
"style": { "useTemplate": "off" }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
// Markdown stays as written: Biome reads two bare globs on one line (Tables/*.sql and Migrations/*.sql) as one
|
|
258
|
+
// emphasis span and rewrites them, and a lint fix under `check --write` would rewrite released changelog sections.
|
|
259
|
+
{
|
|
260
|
+
"includes": ["**/*.md"],
|
|
261
|
+
"formatter": {
|
|
262
|
+
"enabled": false
|
|
263
|
+
},
|
|
264
|
+
"linter": {
|
|
265
|
+
"enabled": false
|
|
266
|
+
}
|
|
196
267
|
}
|
|
197
268
|
]
|
|
198
269
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
// The phone additions to biome.jsonc, for a React Native app only. A phone app extends both, base first:
|
|
3
|
+
// "extends": ["@webority/biome-config/biome.jsonc", "@webority/biome-config/biome.phone.jsonc"].
|
|
4
|
+
// A web app never extends this file: these rules read React Native's text model.
|
|
5
|
+
"root": false,
|
|
6
|
+
"linter": {
|
|
7
|
+
"rules": {
|
|
8
|
+
"correctness": {
|
|
9
|
+
// Raw text outside Text crashes a React Native screen. The skip list names the mobile-ui
|
|
10
|
+
// components that draw their string children inside Text themselves.
|
|
11
|
+
"noReactNativeRawText": {
|
|
12
|
+
"level": "error",
|
|
13
|
+
"options": {
|
|
14
|
+
"skip": ["Markdown", "SectionHeader"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/biome-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Shared Biome lint
|
|
3
|
+
"version": "0.152.0",
|
|
4
|
+
"description": "Shared Webority code standards: the Biome lint and format policy and the TypeScript compiler presets for web apps, phone apps, Razor page scripts and Node packages.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -9,18 +9,26 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"biome.jsonc",
|
|
12
|
+
"biome.phone.jsonc",
|
|
12
13
|
"a11y.jsonc",
|
|
13
|
-
"plugins"
|
|
14
|
+
"plugins",
|
|
15
|
+
"tsconfig"
|
|
14
16
|
],
|
|
15
17
|
"exports": {
|
|
16
18
|
"./biome.jsonc": "./biome.jsonc",
|
|
19
|
+
"./biome.phone.jsonc": "./biome.phone.jsonc",
|
|
17
20
|
"./a11y.jsonc": "./a11y.jsonc",
|
|
18
21
|
"./plugins/*": "./plugins/*",
|
|
22
|
+
"./tsconfig/web.json": "./tsconfig/web.json",
|
|
23
|
+
"./tsconfig/phone.json": "./tsconfig/phone.json",
|
|
24
|
+
"./tsconfig/razor.json": "./tsconfig/razor.json",
|
|
25
|
+
"./tsconfig/node.json": "./tsconfig/node.json",
|
|
19
26
|
"./package.json": "./package.json"
|
|
20
27
|
},
|
|
21
28
|
"main": "biome.jsonc",
|
|
22
29
|
"peerDependencies": {
|
|
23
|
-
"@biomejs/biome": ">=2.5
|
|
30
|
+
"@biomejs/biome": ">=2.6.5",
|
|
31
|
+
"typescript": ">=7.0.2"
|
|
24
32
|
},
|
|
25
33
|
"scripts": {}
|
|
26
34
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// ui-components.md: a form submitted through handleSubmit sets noValidate, so the browser's own validation does not run beside the form library's.
|
|
4
|
+
// AppForm forwards noValidate to its raw form, so it is matched like any other form and passes when it sets the attribute.
|
|
5
|
+
or {
|
|
6
|
+
JsxOpeningElement(name=$name, attributes=$attrs),
|
|
7
|
+
JsxSelfClosingElement(name=$name, attributes=$attrs)
|
|
8
|
+
} as $form where {
|
|
9
|
+
$name <: r"^(?:form|AppForm)$",
|
|
10
|
+
$attrs <: contains `onSubmit={$v}`,
|
|
11
|
+
$v <: contains `handleSubmit`,
|
|
12
|
+
$attrs <: not contains `noValidate`,
|
|
13
|
+
register_diagnostic(span=$form, message="A form whose submit goes through handleSubmit must set noValidate, so the browser's own validation does not run beside the form library's.", severity="error")
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// Reflect.get with a literal key reads a field the type does not declare, so the compiler cannot check the name and a rename passes silently.
|
|
4
|
+
// A variable, member or other expression key is not matched: the key is computed at run time, which the type cannot name anyway.
|
|
5
|
+
or {
|
|
6
|
+
`Reflect.get($obj, $key)` as $call,
|
|
7
|
+
`Reflect.get($obj, $key, $receiver)` as $call
|
|
8
|
+
} where {
|
|
9
|
+
$key <: or {
|
|
10
|
+
JsStringLiteralExpression(),
|
|
11
|
+
r"^`[^`$\\]*`$"
|
|
12
|
+
},
|
|
13
|
+
register_diagnostic(span=$call, message="Reflect.get with a fixed key gets past the type. Read obj.key when the type declares it, or narrow with 'key' in obj, then read obj.key.", severity="error")
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// react.md → Locale formatting: a screen formats dates and numbers through the shared formatters, never a locale call.
|
|
4
|
+
// Matched in any file under a screens/ folder; tests are exempt because they assert on the locale output itself.
|
|
5
|
+
// A GritQL regex matches the whole string, so each filename pattern is wrapped in .*
|
|
6
|
+
or {
|
|
7
|
+
`$obj.$method($args)` as $call where { $method <: r"^toLocale\w*$" },
|
|
8
|
+
`Intl.$member($args)` as $call,
|
|
9
|
+
`new Intl.$member($args)` as $call
|
|
10
|
+
} where {
|
|
11
|
+
$filename <: r".*(?:^|/)screens/.*",
|
|
12
|
+
$filename <: not r".*(?:^|/)(?:__tests__/|[^/]*\.test\.[jt]sx?$)",
|
|
13
|
+
register_diagnostic(span=$call, message="A locale or Intl call in a screen is a violation. Format through the shared formatters: formatDate, formatDateTime, formatNumber, formatINR from @webority/web-core (@webority/mobile-core on phone).", severity="error")
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// AppForm is the one form that drops a double submit and carries an idempotency key; a raw form element bypasses both.
|
|
4
|
+
// Only a script-submitted form (onSubmit) can use AppForm: a native action form posts without script. AppForm.tsx
|
|
5
|
+
// renders the one raw form, and tests render raw forms to exercise fields inside a plain browser form.
|
|
6
|
+
// Matched on the opening tag node: a code snippet of a whole element with children never matches in Biome's GritQL.
|
|
7
|
+
or {
|
|
8
|
+
JsxOpeningElement(name=$name, attributes=$attrs),
|
|
9
|
+
JsxSelfClosingElement(name=$name, attributes=$attrs)
|
|
10
|
+
} as $form where {
|
|
11
|
+
$name <: `form`,
|
|
12
|
+
$attrs <: contains `onSubmit={$_}`,
|
|
13
|
+
$filename <: not r"^(?:.*/)?AppForm\.tsx$",
|
|
14
|
+
$filename <: not r"^(?:.*/)?(?:__tests__/.*|[^/]*\.test\.[jt]sx?)$",
|
|
15
|
+
register_diagnostic(span=$form, message="A raw form element skips the double-submit guard and the idempotency key. Use AppForm from @webority/ui-react.", severity="error")
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// react.md → Redux hygiene: the store keeps its serializable and immutable checks on, so a non-plain value or a mutation fails in development.
|
|
4
|
+
// Matched anywhere; a store file is the only place these options appear.
|
|
5
|
+
or {
|
|
6
|
+
`serializableCheck: false`,
|
|
7
|
+
`immutableCheck: false`
|
|
8
|
+
} as $check where {
|
|
9
|
+
register_diagnostic(span=$check, message="serializableCheck and immutableCheck stay on. Exclude only named ignoredActions or ignoredPaths, each with a one-line reason.", severity="error")
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// react.md → Redux hygiene: a selector returns one primitive or one stored reference, so a component re-renders only when that value changes.
|
|
4
|
+
// A destructured result or an inline selector returns a new object on every call and re-renders on every store update.
|
|
5
|
+
// A node-kind constructor as the declarator's initializer pattern never matches, so the declaration is a snippet.
|
|
6
|
+
// Each inline function kind is its own branch: an or{} of node patterns as a condition on $fn never matches in Biome 2.6.5.
|
|
7
|
+
or {
|
|
8
|
+
`$hook($fn)` as $call where { $fn <: JsArrowFunctionExpression(), $hook <: r"^use(?:App)?Selector$" },
|
|
9
|
+
`$hook($fn)` as $call where { $fn <: JsFunctionExpression(), $hook <: r"^use(?:App)?Selector$" },
|
|
10
|
+
`$hook($fn, $eq)` as $call where { $fn <: JsArrowFunctionExpression(), $hook <: r"^use(?:App)?Selector$" },
|
|
11
|
+
`$hook($fn, $eq)` as $call where { $fn <: JsFunctionExpression(), $hook <: r"^use(?:App)?Selector$" },
|
|
12
|
+
`const $pat = $hook($args)` as $call where { $pat <: JsObjectBindingPattern(), $hook <: r"^use(?:App)?Selector$" }
|
|
13
|
+
} where {
|
|
14
|
+
register_diagnostic(span=$call, message="A selector is a named function returning one primitive or one stored reference. Write useSelector(selectX) and never destructure its result; derived data is a memoized selector exported from the slice file.", severity="error")
|
|
15
|
+
}
|
|
@@ -2,7 +2,31 @@ language js
|
|
|
2
2
|
|
|
3
3
|
// react.md → Failing loud: a catch handles the error, retries it as a classified transient, or logs and rethrows it.
|
|
4
4
|
// A comment alone does not handle it; a documented best-effort path carries `biome-ignore lint/plugin/web-grit-empty-catch: <why>`.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// A promise .catch whose callback is empty or returns only null or undefined swallows the error the same way.
|
|
6
|
+
or {
|
|
7
|
+
JsCatchClause(body=$body) as $catch where {
|
|
8
|
+
$body <: `{}`,
|
|
9
|
+
register_diagnostic(span=$catch, message="This catch swallows the error. Handle it, retry it as a classified transient, or log it and rethrow it. A documented best-effort path says why in a biome-ignore lint/plugin/web-grit-empty-catch comment.", severity="error")
|
|
10
|
+
},
|
|
11
|
+
`$promise.catch($handler)` as $call where {
|
|
12
|
+
$handler <: or {
|
|
13
|
+
`() => {}`,
|
|
14
|
+
`($e) => {}`,
|
|
15
|
+
`async () => {}`,
|
|
16
|
+
`async ($e) => {}`,
|
|
17
|
+
`() => null`,
|
|
18
|
+
`($e) => null`,
|
|
19
|
+
`() => undefined`,
|
|
20
|
+
`($e) => undefined`,
|
|
21
|
+
`() => { return null; }`,
|
|
22
|
+
`($e) => { return null; }`,
|
|
23
|
+
`() => { return undefined; }`,
|
|
24
|
+
`($e) => { return undefined; }`,
|
|
25
|
+
`() => { return; }`,
|
|
26
|
+
`($e) => { return; }`,
|
|
27
|
+
`function () {}`,
|
|
28
|
+
`function ($e) {}`
|
|
29
|
+
},
|
|
30
|
+
register_diagnostic(span=$call, message="This catch swallows the error. Report it, rethrow anything but the one expected failure, or assert it in a test. When another holder of the promise already observes the failure and this line only waits for it to settle, use Promise.allSettled([promise]).", severity="error")
|
|
31
|
+
}
|
|
8
32
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// react.md → API data: a screen reads an RTK Query result only as a DataState.
|
|
4
|
+
// useListQuery and useInfiniteListQuery are web-core list hooks, not generated RTK Query hooks.
|
|
5
|
+
or {
|
|
6
|
+
`$hook($args)` as $call where {
|
|
7
|
+
$hook <: r"^use[A-Z][A-Za-z0-9]*Query$",
|
|
8
|
+
$hook <: not r"^useLazy.*",
|
|
9
|
+
$hook <: not r"^useListQuery$",
|
|
10
|
+
$hook <: not r"^useInfiniteListQuery$"
|
|
11
|
+
},
|
|
12
|
+
`$endpoint.useQuery($args)` as $call,
|
|
13
|
+
`$endpoint.useInfiniteQuery($args)` as $call
|
|
14
|
+
} where {
|
|
15
|
+
$call <: not within or {
|
|
16
|
+
`useDataState($_)`,
|
|
17
|
+
`useDataState($_, $_)`,
|
|
18
|
+
`useInfiniteDataState($_)`
|
|
19
|
+
},
|
|
20
|
+
register_diagnostic(span=$call, message="A query result is read only as a data state. Write useDataState(useXQuery(args)) and draw it with AppAsyncBlock (AsyncBlock on phone), which shows loading, the error with Retry, and empty.", severity="error")
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// react.md: every lazy-loaded screen goes through web-core's reload helper.
|
|
4
|
+
or {
|
|
5
|
+
`lazy: $value` as $prop where {
|
|
6
|
+
$value <: contains `import($_)`,
|
|
7
|
+
$value <: not `importWithReload($_)`,
|
|
8
|
+
register_diagnostic(span=$prop, message="Load the screen through the reload helper: lazy: importWithReload(() => import(...)) on a route, or lazyWithReload(() => import(...)) for a component, both from @webority/web-core/router. Without it a tab opened before a deploy breaks on its next navigation.", severity="error")
|
|
9
|
+
},
|
|
10
|
+
`lazy($arg)` as $call where {
|
|
11
|
+
$arg <: contains `import($_)`,
|
|
12
|
+
register_diagnostic(span=$call, message="Load the screen through the reload helper: lazy: importWithReload(() => import(...)) on a route, or lazyWithReload(() => import(...)) for a component, both from @webority/web-core/router. Without it a tab opened before a deploy breaks on its next navigation.", severity="error")
|
|
13
|
+
},
|
|
14
|
+
`React.lazy($arg)` as $call where {
|
|
15
|
+
$arg <: contains `import($_)`,
|
|
16
|
+
register_diagnostic(span=$call, message="Load the screen through the reload helper: lazy: importWithReload(() => import(...)) on a route, or lazyWithReload(() => import(...)) for a component, both from @webority/web-core/router. Without it a tab opened before a deploy breaks on its next navigation.", severity="error")
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2023"],
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noUncheckedIndexedAccess": true,
|
|
10
|
+
"exactOptionalPropertyTypes": true,
|
|
11
|
+
"noImplicitOverride": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"noUnusedParameters": true,
|
|
16
|
+
"noUncheckedSideEffectImports": true,
|
|
17
|
+
"erasableSyntaxOnly": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
"noEmit": true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2023"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"types": ["jest"],
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noUncheckedIndexedAccess": true,
|
|
11
|
+
"exactOptionalPropertyTypes": true,
|
|
12
|
+
"noImplicitOverride": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noUncheckedSideEffectImports": true,
|
|
18
|
+
"erasableSyntaxOnly": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"isolatedModules": true,
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"resolveJsonModule": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"noEmit": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"noImplicitOverride": true,
|
|
11
|
+
"noImplicitReturns": true,
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noUncheckedSideEffectImports": true,
|
|
16
|
+
"erasableSyntaxOnly": true,
|
|
17
|
+
"verbatimModuleSyntax": true,
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"forceConsistentCasingInFileNames": true,
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"noEmit": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noUncheckedIndexedAccess": true,
|
|
10
|
+
"exactOptionalPropertyTypes": true,
|
|
11
|
+
"noImplicitOverride": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"noUnusedParameters": true,
|
|
16
|
+
"noUncheckedSideEffectImports": true,
|
|
17
|
+
"erasableSyntaxOnly": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
"noEmit": true
|
|
24
|
+
}
|
|
25
|
+
}
|