@shaulavo/standards 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +29 -2
- package/config/oxfmt/base.json +10 -0
- package/config/oxlint/base.json +42 -0
- package/config/oxlint/react.json +40 -0
- package/config/tsconfig/base.json +14 -0
- package/config/tsconfig/bun.json +4 -0
- package/config/tsconfig/dom.json +14 -0
- package/config/tsconfig/nodenext.json +8 -0
- package/dist/cli.js +21470 -0
- package/dist/knip-reporter.js +21 -0
- package/dist/react-compiler-plugin.js +5 -0
- package/package.json +51 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaul Lavo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# standards
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared code-quality gates, CI, project template and Renovate preset for TypeScript, Go and Rust repositories.
|
|
4
|
+
|
|
5
|
+
Each consumer keeps its own `check` command, scopes, exceptions and baselines. This repository supplies the tools, presets, the reusable workflow and the template they share.
|
|
6
|
+
|
|
7
|
+
## Develop
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun install --frozen-lockfile
|
|
11
|
+
bun run check
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Create a project
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
bunx @shaulavo/standards@<version> new my-lib --preset ts-library
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Docs
|
|
21
|
+
|
|
22
|
+
- [Repository contract](docs/repo-contract.md)
|
|
23
|
+
- [Fresh-checkout setup](docs/setup.md)
|
|
24
|
+
- [Creating a new project](docs/new-project.md)
|
|
25
|
+
- [Adopting an existing repository](docs/adoption.md)
|
|
26
|
+
- [Gates and adapters](docs/gates.md)
|
|
27
|
+
- [CI, required checks and releases](docs/ci.md)
|
|
28
|
+
- [Baselines](docs/baselines.md)
|
|
29
|
+
- [Merge guard](docs/merge.md)
|
|
30
|
+
- [Layout and fixture cases](docs/layout.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": ["typescript", "unicorn", "oxc", "import"],
|
|
4
|
+
"categories": {
|
|
5
|
+
"correctness": "error"
|
|
6
|
+
},
|
|
7
|
+
"options": {
|
|
8
|
+
"denyWarnings": true,
|
|
9
|
+
"reportUnusedDisableDirectives": "error",
|
|
10
|
+
"respectEslintDisableDirectives": false
|
|
11
|
+
},
|
|
12
|
+
"rules": {
|
|
13
|
+
"no-unused-vars": [
|
|
14
|
+
"error",
|
|
15
|
+
{
|
|
16
|
+
"args": "all",
|
|
17
|
+
"argsIgnorePattern": "^_",
|
|
18
|
+
"caughtErrors": "all",
|
|
19
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"max-depth": ["error", 2],
|
|
23
|
+
"no-nested-ternary": "error",
|
|
24
|
+
"unicorn/no-nested-ternary": "error",
|
|
25
|
+
"no-else-return": ["error", { "allowElseIf": false }],
|
|
26
|
+
"eqeqeq": ["error", "always"],
|
|
27
|
+
"no-var": "error",
|
|
28
|
+
"prefer-const": "error",
|
|
29
|
+
"no-duplicate-imports": "error",
|
|
30
|
+
"import/no-cycle": "error",
|
|
31
|
+
"typescript/ban-ts-comment": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
"ts-expect-error": "allow-with-description",
|
|
35
|
+
"ts-ignore": "allow-with-description",
|
|
36
|
+
"ts-nocheck": "allow-with-description",
|
|
37
|
+
"ts-check": false,
|
|
38
|
+
"minimumDescriptionLength": 3
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"extends": ["./base.json"],
|
|
4
|
+
"plugins": ["react"],
|
|
5
|
+
"jsPlugins": [
|
|
6
|
+
{ "name": "oxc-react-compiler", "specifier": "../../dist/react-compiler-plugin.js" }
|
|
7
|
+
],
|
|
8
|
+
"rules": {
|
|
9
|
+
"react/rules-of-hooks": "error",
|
|
10
|
+
"react/exhaustive-deps": "error",
|
|
11
|
+
// The React Compiler rules below run the real compiler. Oxlint's native ports of the same checks disagree with it, so they stay off.
|
|
12
|
+
"react/error-boundaries": "off",
|
|
13
|
+
"react/globals": "off",
|
|
14
|
+
"react/immutability": "off",
|
|
15
|
+
"react/incompatible-library": "off",
|
|
16
|
+
"react/preserve-manual-memoization": "off",
|
|
17
|
+
"react/purity": "off",
|
|
18
|
+
"react/refs": "off",
|
|
19
|
+
"react/set-state-in-effect": "off",
|
|
20
|
+
"react/set-state-in-render": "off",
|
|
21
|
+
"react/static-components": "off",
|
|
22
|
+
"react/use-memo": "off",
|
|
23
|
+
"oxc-react-compiler/static-components": "error",
|
|
24
|
+
"oxc-react-compiler/use-memo": "error",
|
|
25
|
+
"oxc-react-compiler/component-hook-factories": "error",
|
|
26
|
+
"oxc-react-compiler/preserve-manual-memoization": "error",
|
|
27
|
+
"oxc-react-compiler/incompatible-library": "error",
|
|
28
|
+
"oxc-react-compiler/immutability": "error",
|
|
29
|
+
"oxc-react-compiler/globals": "error",
|
|
30
|
+
"oxc-react-compiler/refs": "error",
|
|
31
|
+
"oxc-react-compiler/set-state-in-effect": "error",
|
|
32
|
+
"oxc-react-compiler/error-boundaries": "error",
|
|
33
|
+
"oxc-react-compiler/purity": "error",
|
|
34
|
+
"oxc-react-compiler/set-state-in-render": "error",
|
|
35
|
+
"oxc-react-compiler/unsupported-syntax": "error",
|
|
36
|
+
"oxc-react-compiler/config": "error",
|
|
37
|
+
"oxc-react-compiler/gating": "error",
|
|
38
|
+
"oxc-react-compiler/no-unused-directives": "error"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"strict": true,
|
|
5
|
+
"noUncheckedIndexedAccess": true,
|
|
6
|
+
"noFallthroughCasesInSwitch": true,
|
|
7
|
+
"noImplicitOverride": true,
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"moduleDetection": "force",
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"skipLibCheck": true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "Preserve",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"jsx": "react-jsx",
|
|
11
|
+
"types": [],
|
|
12
|
+
"noEmit": true
|
|
13
|
+
}
|
|
14
|
+
}
|