@hiddenability/opinionated-defaults 0.1.49 → 0.1.50
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 +33 -15
- package/dist/oxfmt/index.d.ts +1 -0
- package/dist/oxfmt/index.mjs +1 -0
- package/dist/oxlint/index.d.ts +1 -0
- package/dist/oxlint/index.mjs +1 -0
- package/dist/oxlintrc.json +2 -1
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -25,9 +25,7 @@ A collection of opinionated web-dev tooling configurations.
|
|
|
25
25
|
>
|
|
26
26
|
> **Currently, the only supported package managers are bun and npm**.
|
|
27
27
|
|
|
28
|
-
This package contains a CLI that
|
|
29
|
-
|
|
30
|
-
You can use it by running one of the following commands.
|
|
28
|
+
This package contains a CLI that generates config files for your project. It will prompt you to choose between ESLint + Prettier or Oxlint + Oxfmt.
|
|
31
29
|
|
|
32
30
|
```sh
|
|
33
31
|
bunx @hiddenability/opinionated-defaults
|
|
@@ -37,6 +35,13 @@ bunx @hiddenability/opinionated-defaults
|
|
|
37
35
|
npx @hiddenability/opinionated-defaults
|
|
38
36
|
```
|
|
39
37
|
|
|
38
|
+
You can skip the prompt with flags:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
bunx @hiddenability/opinionated-defaults -es # ESLint + Prettier
|
|
42
|
+
bunx @hiddenability/opinionated-defaults -ox # Oxlint + Oxfmt
|
|
43
|
+
```
|
|
44
|
+
|
|
40
45
|
## Supported Framework Configurations:
|
|
41
46
|
|
|
42
47
|
### Eslint:
|
|
@@ -75,7 +80,11 @@ npx @hiddenability/opinionated-defaults
|
|
|
75
80
|
- [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
|
|
76
81
|
- [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
77
82
|
|
|
78
|
-
### Oxlint:
|
|
83
|
+
### Oxlint (ESLint replacement):
|
|
84
|
+
|
|
85
|
+
#### Exports:
|
|
86
|
+
|
|
87
|
+
- oxlintConfig (Config object for `oxlint.config.ts`)
|
|
79
88
|
|
|
80
89
|
#### Enabled plugins:
|
|
81
90
|
|
|
@@ -90,7 +99,13 @@ npx @hiddenability/opinionated-defaults
|
|
|
90
99
|
- node
|
|
91
100
|
- jsx-a11y
|
|
92
101
|
|
|
93
|
-
### Oxfmt:
|
|
102
|
+
### Oxfmt (Prettier replacement):
|
|
103
|
+
|
|
104
|
+
#### Exports:
|
|
105
|
+
|
|
106
|
+
- oxfmtConfig (Config object for `oxfmt.config.ts`)
|
|
107
|
+
|
|
108
|
+
#### Built-in features:
|
|
94
109
|
|
|
95
110
|
- Import sorting (with newlines between groups)
|
|
96
111
|
- Tailwind CSS class sorting (supports `cva`, `clsx`, `cn`)
|
|
@@ -131,20 +146,23 @@ npm i @hiddenability/opinionated-defaults -D
|
|
|
131
146
|
|
|
132
147
|
### Oxlint:
|
|
133
148
|
|
|
134
|
-
|
|
149
|
+
```ts
|
|
150
|
+
// oxlint.config.ts
|
|
151
|
+
import { defineConfig } from 'oxlint';
|
|
152
|
+
import { oxlintConfig } from '@hiddenability/opinionated-defaults/oxlint';
|
|
135
153
|
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
"extends": [
|
|
139
|
-
"./node_modules/@hiddenability/opinionated-defaults/dist/oxlintrc.json"
|
|
140
|
-
]
|
|
141
|
-
}
|
|
154
|
+
export default defineConfig(oxlintConfig);
|
|
142
155
|
```
|
|
143
156
|
|
|
144
157
|
### Oxfmt:
|
|
145
158
|
|
|
146
|
-
|
|
147
|
-
|
|
159
|
+
```ts
|
|
160
|
+
// oxfmt.config.ts
|
|
161
|
+
import { defineConfig } from 'oxfmt';
|
|
162
|
+
import { oxfmtConfig } from '@hiddenability/opinionated-defaults/oxfmt';
|
|
163
|
+
|
|
164
|
+
export default defineConfig(oxfmtConfig);
|
|
165
|
+
```
|
|
148
166
|
|
|
149
167
|
### Eslint:
|
|
150
168
|
|
|
@@ -207,7 +225,7 @@ For example, given the following css file:
|
|
|
207
225
|
@import 'tailwindcss';
|
|
208
226
|
```
|
|
209
227
|
|
|
210
|
-
This
|
|
228
|
+
This could be a minimal version of your Prettier config:
|
|
211
229
|
|
|
212
230
|
```ts
|
|
213
231
|
// prettier.config.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as oxfmtConfig } from "../oxfmtrc.json";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={arrowParens:"always",bracketSameLine:!1,bracketSpacing:!0,jsxSingleQuote:!0,semi:!0,singleQuote:!0,tabWidth:2,trailingComma:"all",useTabs:!1,sortImports:{newlinesBetween:!0},sortTailwindcss:{functions:["cva","clsx","cn"]}};export{t as oxfmtConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as oxlintConfig } from "../oxlintrc.json";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={$schema:"./node_modules/oxlint/configuration_schema.json",categories:{correctness:"error",suspicious:"warn"},plugins:["typescript","unicorn","oxc","import","react","react-perf","nextjs","promise","node","jsx-a11y"],env:{es6:!0,browser:!0,node:!0},ignorePatterns:["**/dist/","**/node_modules/","**/.git/"],options:{typeAware:!0,typeCheck:!0},rules:{"typescript/no-misused-promises":["error",{checksVoidReturn:!1}],"no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"typescript/prefer-nullish-coalescing":"error","unicorn/filename-case":["error",{cases:{kebabCase:!0}}],"unicorn/no-array-for-each":"off","unicorn/no-array-reduce":"off"}};export{e as oxlintConfig};
|
package/dist/oxlintrc.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hiddenability/opinionated-defaults",
|
|
3
3
|
"description": "Opinionated default configurations for webdev tools.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.50",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,6 +29,18 @@
|
|
|
29
29
|
"types": "./dist/prettier/index.d.ts"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
"./oxlint": {
|
|
33
|
+
"import": {
|
|
34
|
+
"default": "./dist/oxlint/index.mjs",
|
|
35
|
+
"types": "./dist/oxlint/index.d.ts"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"./oxfmt": {
|
|
39
|
+
"import": {
|
|
40
|
+
"default": "./dist/oxfmt/index.mjs",
|
|
41
|
+
"types": "./dist/oxfmt/index.d.ts"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
32
44
|
"./oxlintrc": {
|
|
33
45
|
"import": {
|
|
34
46
|
"default": "./dist/oxlintrc.json"
|