@adbayb/stack 2.40.0 → 3.0.0-next-3def11e
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 +4 -4
- package/bin/index.js +2 -4
- package/configs/{prettier → oxfmt}/README.md +6 -14
- package/configs/oxfmt/index.ts +41 -0
- package/configs/{eslint → oxlint}/README.md +4 -4
- package/configs/oxlint/index.ts +319 -0
- package/configs/typescript/index.json +1 -7
- package/dist/configs/oxfmt.d.ts +32 -0
- package/dist/configs/oxfmt.js +37 -0
- package/dist/configs/oxlint.d.ts +273 -0
- package/dist/configs/oxlint.js +325 -0
- package/dist/index.js +261 -249
- package/package.json +42 -48
- package/templates/multi-projects/.github/workflows/continuous_delivery.yml +3 -3
- package/templates/multi-projects/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/multi-projects/.github/workflows/workflow.yml +3 -3
- package/templates/multi-projects/.vscode/extensions.json +1 -1
- package/templates/multi-projects/.vscode/settings.json +7 -13
- package/templates/multi-projects/libraries/{{projectName}}/package.json +10 -10
- package/templates/multi-projects/oxfmt.config.ts +1 -0
- package/templates/multi-projects/oxlint.config.ts +1 -0
- package/templates/multi-projects/package.json +3 -4
- package/templates/multi-projects/pnpm-workspace.yaml +8 -9
- package/templates/single-project/.github/workflows/continuous_delivery.yml +3 -3
- package/templates/single-project/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/single-project/.github/workflows/workflow.yml +3 -3
- package/templates/single-project/.vscode/extensions.json +1 -1
- package/templates/single-project/.vscode/settings.json +7 -13
- package/templates/single-project/oxfmt.config.ts +1 -0
- package/templates/single-project/oxlint.config.ts +1 -0
- package/templates/single-project/package.json +3 -4
- package/templates/single-project/pnpm-workspace.yaml +8 -9
- package/templates/single-project/{{projectName}}/package.json +10 -10
- package/configs/eslint/constants.js +0 -37
- package/configs/eslint/helpers.js +0 -5
- package/configs/eslint/index.js +0 -30
- package/configs/eslint/presets/dependencies.js +0 -14
- package/configs/eslint/presets/eslint.js +0 -133
- package/configs/eslint/presets/import.js +0 -65
- package/configs/eslint/presets/jsdoc.js +0 -78
- package/configs/eslint/presets/markdown.js +0 -1
- package/configs/eslint/presets/node.js +0 -51
- package/configs/eslint/presets/prettier.js +0 -1
- package/configs/eslint/presets/react.js +0 -111
- package/configs/eslint/presets/sonar.js +0 -201
- package/configs/eslint/presets/stylistic.js +0 -79
- package/configs/eslint/presets/test.js +0 -87
- package/configs/eslint/presets/typescript.js +0 -198
- package/configs/eslint/presets/unicorn.js +0 -257
- package/configs/prettier/index.js +0 -25
- package/templates/multi-projects/.nvmrc +0 -1
- package/templates/multi-projects/eslint.config.js.tmpl +0 -1
- package/templates/single-project/.nvmrc +0 -1
- package/templates/single-project/eslint.config.js.tmpl +0 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- Support for several application templates (for now, only a default template is available, but others can be added later)
|
|
14
14
|
- Standardized file structure including optional folder creation such as `examples`, `packages`, ...
|
|
15
15
|
- Enable all project lifecycle steps with commands from the setup, check, fix, build, and test to the versioning and release
|
|
16
|
-
- Built-in configuration preset setup (including Node/NPM runtime, Git ignore/hooks, [TypeScript](https://github.com/adbayb/stack/blob/main/stack/configs/typescript/), [
|
|
16
|
+
- Built-in configuration preset setup (including Node/NPM runtime, Git ignore/hooks, [TypeScript](https://github.com/adbayb/stack/blob/main/stack/configs/typescript/), [Oxlint](https://github.com/adbayb/stack/blob/main/stack/configs/oxlint/), [Oxfmt](https://github.com/adbayb/stack/blob/main/stack/configs/oxfmt/), EditorConfig, Renovate, Changesets, and VSCode)
|
|
17
17
|
- A welcoming environment for users and contributors with the continuous integration setup, and the creation of `README.md`, `CONTRIBUTING.md`, and GitHub template files (including issue and pull request ones), ...
|
|
18
18
|
- An optimized development environment with command caching (no build needed if nothing changes)
|
|
19
19
|
|
|
@@ -63,13 +63,13 @@ stack release
|
|
|
63
63
|
|
|
64
64
|
### Available configurations
|
|
65
65
|
|
|
66
|
-
- [@adbayb/stack/
|
|
67
|
-
- [@adbayb/stack/
|
|
66
|
+
- [@adbayb/stack/oxlint](https://github.com/adbayb/stack/blob/main/stack/configs/oxlint/) to align logical and stylistic rules across projects.
|
|
67
|
+
- [@adbayb/stack/oxfmt](https://github.com/adbayb/stack/blob/main/stack/configs/oxfmt/) to align code formatting conventions across projects.
|
|
68
68
|
- [@adbayb/stack/typescript](https://github.com/adbayb/stack/blob/main/stack/configs/typescript/) to align type checking and processing across projects.
|
|
69
69
|
|
|
70
70
|
### Used technologies
|
|
71
71
|
|
|
72
|
-
- **Static code analysis**:
|
|
72
|
+
- **Static code analysis**: Oxlint, Oxfmt
|
|
73
73
|
- **Node package manager**: PNPM
|
|
74
74
|
- **Task orchestration**: Turborepo
|
|
75
75
|
- **Release**: Changesets
|
package/bin/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import pkg from "../package.json" with { type: "json" };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import(new URL(`../${package_.exports["."].default}`, import.meta.url));
|
|
5
|
+
void import(new URL(`../${pkg.exports["."].default}`, import.meta.url));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<br>
|
|
2
2
|
<div align="center">
|
|
3
|
-
<h1>@adbayb/stack/
|
|
3
|
+
<h1>@adbayb/stack/oxfmt</h1>
|
|
4
4
|
<strong>My opinionated formatting standards</strong>
|
|
5
5
|
</div>
|
|
6
6
|
<br>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## ✨ Features
|
|
10
10
|
|
|
11
|
-
This package offers opinionated but extensible **[
|
|
11
|
+
This package offers opinionated but extensible **[Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html)** configurations to align code formatting conventions across projects.
|
|
12
12
|
|
|
13
13
|
It allows to:
|
|
14
14
|
|
|
@@ -30,18 +30,10 @@ pnpm add @adbayb/stack --save-dev --workspace-root
|
|
|
30
30
|
|
|
31
31
|
### 2️⃣ Usage
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
{
|
|
37
|
-
"scripts": {
|
|
38
|
-
"check:format": "prettier \"**/!(pnpm-lock.yaml)\" --check --ignore-unknown --ignore-path .gitignore --log-level warn",
|
|
39
|
-
"fix:format": "pnpm check:format --write",
|
|
40
|
-
// ...
|
|
41
|
-
},
|
|
42
|
-
"prettier": "@adbayb/stack/prettier",
|
|
43
|
-
// ...
|
|
44
|
-
}
|
|
33
|
+
Create a `oxfmt.config.ts` file and include the following:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export { default } from "@adbayb/stack/oxfmt";
|
|
45
37
|
```
|
|
46
38
|
|
|
47
39
|
<br />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { OxfmtConfig } from "oxfmt";
|
|
2
|
+
import { defineConfig } from "oxfmt";
|
|
3
|
+
|
|
4
|
+
const config = defineConfig({
|
|
5
|
+
arrowParens: "always",
|
|
6
|
+
bracketSameLine: false,
|
|
7
|
+
bracketSpacing: true,
|
|
8
|
+
embeddedLanguageFormatting: "auto",
|
|
9
|
+
endOfLine: "lf",
|
|
10
|
+
htmlWhitespaceSensitivity: "css",
|
|
11
|
+
ignorePatterns: [],
|
|
12
|
+
insertFinalNewline: true,
|
|
13
|
+
jsdoc: true,
|
|
14
|
+
jsxSingleQuote: false,
|
|
15
|
+
objectWrap: "preserve",
|
|
16
|
+
printWidth: 100,
|
|
17
|
+
proseWrap: "preserve",
|
|
18
|
+
quoteProps: "consistent",
|
|
19
|
+
semi: true,
|
|
20
|
+
singleAttributePerLine: true,
|
|
21
|
+
singleQuote: false,
|
|
22
|
+
sortImports: {
|
|
23
|
+
newlinesBetween: false,
|
|
24
|
+
},
|
|
25
|
+
sortPackageJson: true,
|
|
26
|
+
tabWidth: 4,
|
|
27
|
+
trailingComma: "all",
|
|
28
|
+
useTabs: true,
|
|
29
|
+
vueIndentScriptAndStyle: false,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const createConfig = ({
|
|
33
|
+
overrides,
|
|
34
|
+
}: Required<Pick<OxfmtConfig, "overrides">>): OxfmtConfig => {
|
|
35
|
+
return {
|
|
36
|
+
...config,
|
|
37
|
+
overrides,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<br>
|
|
2
2
|
<div align="center">
|
|
3
|
-
<h1>@adbayb/stack/
|
|
3
|
+
<h1>@adbayb/stack/oxlint</h1>
|
|
4
4
|
<strong>My opinionated linter standards</strong>
|
|
5
5
|
</div>
|
|
6
6
|
<br>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## ✨ Features
|
|
10
10
|
|
|
11
|
-
This package offers opinionated but extensible **[
|
|
11
|
+
This package offers opinionated but extensible **[Oxlint](https://oxc.rs/docs/guide/usage/linter.html)** configurations to align logical and stylistic rules across projects.
|
|
12
12
|
|
|
13
13
|
It allows to:
|
|
14
14
|
|
|
@@ -30,10 +30,10 @@ pnpm add @adbayb/stack --save-dev --workspace-root
|
|
|
30
30
|
|
|
31
31
|
### 2️⃣ Usage
|
|
32
32
|
|
|
33
|
-
Create a `
|
|
33
|
+
Create a `oxlint.config.ts` file and include the following:
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
export { default } from "@adbayb/stack/
|
|
36
|
+
export { default } from "@adbayb/stack/oxlint";
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
<br />
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import e18ePlugin from "@e18e/eslint-plugin";
|
|
2
|
+
import { configs as perfectionistPlugin } from "eslint-plugin-perfectionist";
|
|
3
|
+
import type { OxlintConfig } from "oxlint";
|
|
4
|
+
import { defineConfig } from "oxlint";
|
|
5
|
+
|
|
6
|
+
const JAVASCRIPT_EXTENSIONS = ["js", "jsx", "cjs", "mjs", "mjsx"];
|
|
7
|
+
const JAVASCRIPT_EXTENSIONS_AS_STRING = JAVASCRIPT_EXTENSIONS.join(",");
|
|
8
|
+
const JAVASCRIPT_FILES = [`**/*.{${JAVASCRIPT_EXTENSIONS_AS_STRING}}`];
|
|
9
|
+
const TYPESCRIPT_EXTENSIONS = ["ts", "tsx", "cts", "mts", "mtsx"];
|
|
10
|
+
const JAVASCRIPT_LIKE_EXTENSIONS = [...JAVASCRIPT_EXTENSIONS, ...TYPESCRIPT_EXTENSIONS];
|
|
11
|
+
const JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING = JAVASCRIPT_LIKE_EXTENSIONS.join(",");
|
|
12
|
+
|
|
13
|
+
const TEST_LIKE_FILES = [
|
|
14
|
+
`**/{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
15
|
+
`**/*.{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const config = defineConfig({
|
|
19
|
+
categories: {
|
|
20
|
+
correctness: "error",
|
|
21
|
+
nursery: "error",
|
|
22
|
+
pedantic: "error",
|
|
23
|
+
perf: "error",
|
|
24
|
+
restriction: "error",
|
|
25
|
+
style: "error",
|
|
26
|
+
suspicious: "error",
|
|
27
|
+
},
|
|
28
|
+
jsPlugins: ["@e18e/eslint-plugin", "@stylistic/eslint-plugin", "eslint-plugin-perfectionist"],
|
|
29
|
+
options: {
|
|
30
|
+
denyWarnings: true,
|
|
31
|
+
reportUnusedDisableDirectives: "error",
|
|
32
|
+
respectEslintDisableDirectives: false,
|
|
33
|
+
typeAware: true,
|
|
34
|
+
typeCheck: true,
|
|
35
|
+
},
|
|
36
|
+
overrides: [
|
|
37
|
+
{
|
|
38
|
+
files: ["**/*.d.ts"],
|
|
39
|
+
rules: {
|
|
40
|
+
"unicorn/require-module-specifiers": "off",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
files: JAVASCRIPT_FILES,
|
|
45
|
+
rules: {
|
|
46
|
+
// Following disabled rules are required until this issue is resolved https://github.com/oxc-project/oxc/issues/20073
|
|
47
|
+
"typescript/no-unsafe-assignment": "off",
|
|
48
|
+
"typescript/no-unsafe-call": "off",
|
|
49
|
+
"typescript/no-unsafe-member-access": "off",
|
|
50
|
+
"typescript/no-unsafe-return": "off",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
files: TEST_LIKE_FILES,
|
|
55
|
+
plugins: ["vitest"],
|
|
56
|
+
rules: {
|
|
57
|
+
"vitest/consistent-test-it": ["error", { fn: "test", withinDescribe: "test" }],
|
|
58
|
+
"vitest/max-expects": "off",
|
|
59
|
+
"vitest/no-hooks": "off",
|
|
60
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
61
|
+
"vitest/prefer-expect-assertions": "off",
|
|
62
|
+
"vitest/prefer-to-be-falsy": "off",
|
|
63
|
+
"vitest/prefer-to-be-truthy": "off",
|
|
64
|
+
"vitest/require-mock-type-parameters": "off",
|
|
65
|
+
"vitest/require-test-timeout": "off",
|
|
66
|
+
"vitest/valid-title": [
|
|
67
|
+
"error",
|
|
68
|
+
{ allowArguments: true, mustMatch: { test: ["^should "] } },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
files: [
|
|
74
|
+
...TEST_LIKE_FILES,
|
|
75
|
+
"**/.config/**",
|
|
76
|
+
"**/.configs/**",
|
|
77
|
+
"**/config/**",
|
|
78
|
+
"**/configs/**",
|
|
79
|
+
"**/examples/**",
|
|
80
|
+
"**/scripts/**",
|
|
81
|
+
"**/tools/**",
|
|
82
|
+
`**/config.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
83
|
+
`**/configs.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
84
|
+
`**/*.config.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
85
|
+
`**/*.configs.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
86
|
+
`**/stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
87
|
+
`**/*.stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
88
|
+
],
|
|
89
|
+
rules: {
|
|
90
|
+
"e18e/prefer-static-regex": "off",
|
|
91
|
+
"import/no-anonymous-default-export": "off",
|
|
92
|
+
"import/no-default-export": "off",
|
|
93
|
+
"react/forbid-component-props": "off",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
plugins: [
|
|
98
|
+
"eslint",
|
|
99
|
+
"import",
|
|
100
|
+
"jsdoc",
|
|
101
|
+
"jsx-a11y",
|
|
102
|
+
"node",
|
|
103
|
+
"oxc",
|
|
104
|
+
"promise",
|
|
105
|
+
"react",
|
|
106
|
+
// "react-perf", // is disabled because it flags patterns that are often harmless, its optimization rules don't align well with modern React performance guidance, it generates more noise than value, and we prefer profiling-driven optimizations over enforced manual optimizations.
|
|
107
|
+
"typescript",
|
|
108
|
+
"unicorn",
|
|
109
|
+
],
|
|
110
|
+
rules: {
|
|
111
|
+
...e18ePlugin.configs.recommended.rules,
|
|
112
|
+
...perfectionistPlugin["recommended-natural"].rules,
|
|
113
|
+
...Object.fromEntries(
|
|
114
|
+
[
|
|
115
|
+
"sort-export-attributes",
|
|
116
|
+
"sort-import-attributes",
|
|
117
|
+
"sort-interfaces",
|
|
118
|
+
"sort-jsx-props",
|
|
119
|
+
"sort-maps",
|
|
120
|
+
"sort-object-types",
|
|
121
|
+
"sort-objects",
|
|
122
|
+
"sort-union-types",
|
|
123
|
+
"sort-variable-declarations",
|
|
124
|
+
].map((ruleName) => {
|
|
125
|
+
return [
|
|
126
|
+
`perfectionist/${ruleName}`,
|
|
127
|
+
[
|
|
128
|
+
"error",
|
|
129
|
+
{
|
|
130
|
+
customGroups: [
|
|
131
|
+
{
|
|
132
|
+
elementNamePattern:
|
|
133
|
+
"^(as|children|id|identifier|htmlFor|key|ref)$",
|
|
134
|
+
groupName: "id-like",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
elementNamePattern: "^(label|name|title)$",
|
|
138
|
+
groupName: "name-like",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
elementNamePattern: "^(description|metadata)$",
|
|
142
|
+
groupName: "metadata-like",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
groups: ["id-like", "name-like", "metadata-like", "unknown"],
|
|
146
|
+
type: "natural",
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
];
|
|
150
|
+
}),
|
|
151
|
+
),
|
|
152
|
+
"@stylistic/jsx-pascal-case": "error",
|
|
153
|
+
"@stylistic/jsx-self-closing-comp": "error",
|
|
154
|
+
"@stylistic/lines-between-class-members": "error",
|
|
155
|
+
"@stylistic/multiline-comment-style": "error",
|
|
156
|
+
"@stylistic/padded-blocks": ["error", "never"],
|
|
157
|
+
"@stylistic/padding-line-between-statements": [
|
|
158
|
+
"error",
|
|
159
|
+
// Default: separate everything.
|
|
160
|
+
{
|
|
161
|
+
blankLine: "always",
|
|
162
|
+
next: "*",
|
|
163
|
+
prev: "*",
|
|
164
|
+
},
|
|
165
|
+
// Keep single-line variable declarations together
|
|
166
|
+
{
|
|
167
|
+
blankLine: "never",
|
|
168
|
+
next: ["singleline-const", "singleline-let", "singleline-var"],
|
|
169
|
+
prev: ["singleline-const", "singleline-let", "singleline-var"],
|
|
170
|
+
},
|
|
171
|
+
// Keep single-line exports together
|
|
172
|
+
{
|
|
173
|
+
blankLine: "never",
|
|
174
|
+
next: ["singleline-export"],
|
|
175
|
+
prev: ["singleline-export"],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
blankLine: "never",
|
|
179
|
+
next: ["cjs-export"],
|
|
180
|
+
prev: ["cjs-export"],
|
|
181
|
+
},
|
|
182
|
+
// Keep statements together
|
|
183
|
+
{
|
|
184
|
+
blankLine: "never",
|
|
185
|
+
next: ["singleline-expression"],
|
|
186
|
+
prev: ["singleline-expression"],
|
|
187
|
+
},
|
|
188
|
+
// Keep imports together.
|
|
189
|
+
{
|
|
190
|
+
blankLine: "never",
|
|
191
|
+
next: ["import"],
|
|
192
|
+
prev: ["import"],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
blankLine: "never",
|
|
196
|
+
next: ["cjs-import"],
|
|
197
|
+
prev: ["cjs-import"],
|
|
198
|
+
},
|
|
199
|
+
// Keep directives together
|
|
200
|
+
{
|
|
201
|
+
blankLine: "never",
|
|
202
|
+
next: "directive",
|
|
203
|
+
prev: "directive",
|
|
204
|
+
},
|
|
205
|
+
// Keep switch labels together
|
|
206
|
+
{
|
|
207
|
+
blankLine: "never",
|
|
208
|
+
next: ["case", "default"],
|
|
209
|
+
prev: ["case", "default"],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
blankLine: "never",
|
|
213
|
+
next: "*",
|
|
214
|
+
prev: ["case", "default"],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
"@stylistic/quotes": [
|
|
218
|
+
"error",
|
|
219
|
+
"double",
|
|
220
|
+
{ allowTemplateLiterals: "avoidEscape", avoidEscape: true },
|
|
221
|
+
],
|
|
222
|
+
"@stylistic/spaced-comment": "error",
|
|
223
|
+
"arrow-body-style": ["error", "always"],
|
|
224
|
+
"class-methods-use-this": "off",
|
|
225
|
+
"id-length": "off",
|
|
226
|
+
"import/exports-last": "off",
|
|
227
|
+
"import/group-exports": "off",
|
|
228
|
+
"import/max-dependencies": "off",
|
|
229
|
+
"import/no-dynamic-require": "off",
|
|
230
|
+
"import/no-named-export": "off",
|
|
231
|
+
"import/no-nodejs-modules": "off",
|
|
232
|
+
"import/no-relative-parent-imports": "off",
|
|
233
|
+
"import/prefer-default-export": "off",
|
|
234
|
+
"import/unambiguous": "off",
|
|
235
|
+
"init-declarations": "off",
|
|
236
|
+
"jsdoc/require-param-type": "off",
|
|
237
|
+
"jsdoc/require-property-type": "off",
|
|
238
|
+
"jsdoc/require-returns-type": "off",
|
|
239
|
+
"max-classes-per-file": "off",
|
|
240
|
+
"max-lines": "off",
|
|
241
|
+
"max-lines-per-function": "off",
|
|
242
|
+
"max-params": "off",
|
|
243
|
+
"max-statements": "off",
|
|
244
|
+
"nextjs/google-font-display": "error",
|
|
245
|
+
"nextjs/google-font-preconnect": "error",
|
|
246
|
+
"nextjs/no-sync-scripts": "error",
|
|
247
|
+
"nextjs/no-unwanted-polyfillio": "error",
|
|
248
|
+
"no-async-await": "off",
|
|
249
|
+
"no-await-in-loop": "off",
|
|
250
|
+
"no-bitwise": "off",
|
|
251
|
+
"no-console": "off",
|
|
252
|
+
"no-continue": "off",
|
|
253
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
254
|
+
"no-inline-comments": "off",
|
|
255
|
+
"no-magic-numbers": "off",
|
|
256
|
+
"no-optional-chaining": "off",
|
|
257
|
+
"no-param-reassign": "off",
|
|
258
|
+
"no-plusplus": "off",
|
|
259
|
+
"no-rest-spread-properties": "off",
|
|
260
|
+
"no-ternary": "off",
|
|
261
|
+
"no-undef": "off",
|
|
262
|
+
"no-undefined": "off",
|
|
263
|
+
"no-underscore-dangle": "off",
|
|
264
|
+
"no-use-before-define": "off",
|
|
265
|
+
"no-useless-return": "off",
|
|
266
|
+
"no-void": "off",
|
|
267
|
+
"no-warning-comments": "off",
|
|
268
|
+
"node/no-process-env": "off",
|
|
269
|
+
"node/no-sync": "off",
|
|
270
|
+
"node/no-top-level-await": ["error", { ignoreBin: true }],
|
|
271
|
+
"oxc/no-async-endpoint-handlers": "off",
|
|
272
|
+
"perfectionist/sort-imports": "off", // Already supported by Oxfmt
|
|
273
|
+
"perfectionist/sort-named-imports": "off", // Already supported by eslint/sort-imports
|
|
274
|
+
"prefer-named-capture-group": "off",
|
|
275
|
+
"prefer-readonly-parameter-types": "off",
|
|
276
|
+
"promise/avoid-new": "off",
|
|
277
|
+
"react/function-component-definition": "off",
|
|
278
|
+
"react/jsx-filename-extension": ["error", { extensions: ["jsx", "tsx"] }],
|
|
279
|
+
"react/jsx-max-depth": "off",
|
|
280
|
+
"react/jsx-no-literals": "off",
|
|
281
|
+
"react/jsx-props-no-spreading": "off",
|
|
282
|
+
"react/no-multi-comp": "off",
|
|
283
|
+
"react/prefer-function-component": [
|
|
284
|
+
"error",
|
|
285
|
+
{ allowErrorBoundary: true, allowJsxUtilityClass: true },
|
|
286
|
+
],
|
|
287
|
+
"react/react-in-jsx-scope": "off",
|
|
288
|
+
"require-await": "off", // Already better covered by "typescript/require-await"
|
|
289
|
+
"sort-imports": "off", // Already supported by ESLint Perfectionist
|
|
290
|
+
"sort-keys": "off", // Already supported by ESLint Perfectionist
|
|
291
|
+
"sort-vars": "off", // Already supported by ESLint Perfectionist
|
|
292
|
+
"strict-boolean-expressions": "off",
|
|
293
|
+
"typescript/ban-types": "off", // Deprecated
|
|
294
|
+
"typescript/consistent-return": "off",
|
|
295
|
+
"typescript/consistent-type-definitions": ["error", "type"],
|
|
296
|
+
"typescript/explicit-function-return-type": "off",
|
|
297
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
298
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
299
|
+
"typescript/non-nullable-type-assertion-style": "off",
|
|
300
|
+
"unicorn/filename-case": "off",
|
|
301
|
+
"unicorn/import-style": "off",
|
|
302
|
+
"unicorn/no-array-for-each": "off",
|
|
303
|
+
"unicorn/no-array-reduce": "off",
|
|
304
|
+
"unicorn/no-useless-switch-case": "off",
|
|
305
|
+
"unicorn/no-useless-undefined": "off",
|
|
306
|
+
"unicorn/prefer-math-trunc": "off", // No really identical replacement especially for `hash >>> 0` ensuring a positive integer
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
export const createConfig = ({
|
|
311
|
+
ignorePatterns,
|
|
312
|
+
}: Required<Pick<OxlintConfig, "ignorePatterns">>): OxlintConfig => {
|
|
313
|
+
return {
|
|
314
|
+
...config,
|
|
315
|
+
ignorePatterns,
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export default config;
|
|
@@ -10,13 +10,7 @@
|
|
|
10
10
|
"exactOptionalPropertyTypes": true,
|
|
11
11
|
"incremental": true,
|
|
12
12
|
"jsx": "react-jsx",
|
|
13
|
-
"lib": [
|
|
14
|
-
"ESNext",
|
|
15
|
-
"DOM",
|
|
16
|
-
"DOM.AsyncIterable",
|
|
17
|
-
"DOM.Iterable",
|
|
18
|
-
"WebWorker.ImportScripts"
|
|
19
|
-
],
|
|
13
|
+
"lib": ["ESNext", "DOM", "DOM.AsyncIterable", "DOM.Iterable", "WebWorker.ImportScripts"],
|
|
20
14
|
"module": "Preserve",
|
|
21
15
|
"noEmit": true,
|
|
22
16
|
"noErrorTruncation": true,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { OxfmtConfig } from "oxfmt";
|
|
2
|
+
//#region configs/oxfmt/index.d.ts
|
|
3
|
+
declare const config: {
|
|
4
|
+
arrowParens: "always";
|
|
5
|
+
bracketSameLine: false;
|
|
6
|
+
bracketSpacing: true;
|
|
7
|
+
embeddedLanguageFormatting: "auto";
|
|
8
|
+
endOfLine: "lf";
|
|
9
|
+
htmlWhitespaceSensitivity: "css";
|
|
10
|
+
ignorePatterns: never[];
|
|
11
|
+
insertFinalNewline: true;
|
|
12
|
+
jsdoc: true;
|
|
13
|
+
jsxSingleQuote: false;
|
|
14
|
+
objectWrap: "preserve";
|
|
15
|
+
printWidth: number;
|
|
16
|
+
proseWrap: "preserve";
|
|
17
|
+
quoteProps: "consistent";
|
|
18
|
+
semi: true;
|
|
19
|
+
singleAttributePerLine: true;
|
|
20
|
+
singleQuote: false;
|
|
21
|
+
sortImports: {
|
|
22
|
+
newlinesBetween: false;
|
|
23
|
+
};
|
|
24
|
+
sortPackageJson: true;
|
|
25
|
+
tabWidth: number;
|
|
26
|
+
trailingComma: "all";
|
|
27
|
+
useTabs: true;
|
|
28
|
+
vueIndentScriptAndStyle: false;
|
|
29
|
+
};
|
|
30
|
+
declare const createConfig: ({ overrides }: Required<Pick<OxfmtConfig, "overrides">>) => OxfmtConfig;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { createConfig, config as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineConfig } from "oxfmt";
|
|
2
|
+
|
|
3
|
+
//#region configs/oxfmt/index.ts
|
|
4
|
+
const config = defineConfig({
|
|
5
|
+
arrowParens: "always",
|
|
6
|
+
bracketSameLine: false,
|
|
7
|
+
bracketSpacing: true,
|
|
8
|
+
embeddedLanguageFormatting: "auto",
|
|
9
|
+
endOfLine: "lf",
|
|
10
|
+
htmlWhitespaceSensitivity: "css",
|
|
11
|
+
ignorePatterns: [],
|
|
12
|
+
insertFinalNewline: true,
|
|
13
|
+
jsdoc: true,
|
|
14
|
+
jsxSingleQuote: false,
|
|
15
|
+
objectWrap: "preserve",
|
|
16
|
+
printWidth: 100,
|
|
17
|
+
proseWrap: "preserve",
|
|
18
|
+
quoteProps: "consistent",
|
|
19
|
+
semi: true,
|
|
20
|
+
singleAttributePerLine: true,
|
|
21
|
+
singleQuote: false,
|
|
22
|
+
sortImports: { newlinesBetween: false },
|
|
23
|
+
sortPackageJson: true,
|
|
24
|
+
tabWidth: 4,
|
|
25
|
+
trailingComma: "all",
|
|
26
|
+
useTabs: true,
|
|
27
|
+
vueIndentScriptAndStyle: false
|
|
28
|
+
});
|
|
29
|
+
const createConfig = ({ overrides }) => {
|
|
30
|
+
return {
|
|
31
|
+
...config,
|
|
32
|
+
overrides
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { createConfig, config as default };
|