@hiddenability/opinionated-defaults 0.1.47 → 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 +61 -6
- package/dist/eslint/better-tailwindcss.d.ts +3 -0
- package/dist/eslint/index.d.ts +1 -0
- package/dist/eslint/index.mjs +1 -1
- package/dist/oxfmt/index.d.ts +1 -0
- package/dist/oxfmt/index.mjs +1 -0
- package/dist/oxfmtrc.json +17 -0
- package/dist/oxlint/index.d.ts +1 -0
- package/dist/oxlint/index.mjs +1 -0
- package/dist/oxlintrc.json +48 -0
- package/package.json +31 -8
package/README.md
CHANGED
|
@@ -25,18 +25,23 @@ 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
|
|
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.
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
30
|
+
```sh
|
|
33
31
|
bunx @hiddenability/opinionated-defaults
|
|
34
32
|
```
|
|
35
33
|
|
|
36
|
-
```
|
|
34
|
+
```sh
|
|
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,6 +80,36 @@ 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
|
|
|
83
|
+
### Oxlint (ESLint replacement):
|
|
84
|
+
|
|
85
|
+
#### Exports:
|
|
86
|
+
|
|
87
|
+
- oxlintConfig (Config object for `oxlint.config.ts`)
|
|
88
|
+
|
|
89
|
+
#### Enabled plugins:
|
|
90
|
+
|
|
91
|
+
- typescript
|
|
92
|
+
- unicorn
|
|
93
|
+
- oxc
|
|
94
|
+
- import
|
|
95
|
+
- react
|
|
96
|
+
- react-perf
|
|
97
|
+
- nextjs
|
|
98
|
+
- promise
|
|
99
|
+
- node
|
|
100
|
+
- jsx-a11y
|
|
101
|
+
|
|
102
|
+
### Oxfmt (Prettier replacement):
|
|
103
|
+
|
|
104
|
+
#### Exports:
|
|
105
|
+
|
|
106
|
+
- oxfmtConfig (Config object for `oxfmt.config.ts`)
|
|
107
|
+
|
|
108
|
+
#### Built-in features:
|
|
109
|
+
|
|
110
|
+
- Import sorting (with newlines between groups)
|
|
111
|
+
- Tailwind CSS class sorting (supports `cva`, `clsx`, `cn`)
|
|
112
|
+
|
|
78
113
|
### Prettier:
|
|
79
114
|
|
|
80
115
|
- Astro
|
|
@@ -109,6 +144,26 @@ npm i @hiddenability/opinionated-defaults -D
|
|
|
109
144
|
|
|
110
145
|
## Usage:
|
|
111
146
|
|
|
147
|
+
### Oxlint:
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
// oxlint.config.ts
|
|
151
|
+
import { defineConfig } from 'oxlint';
|
|
152
|
+
import { oxlintConfig } from '@hiddenability/opinionated-defaults/oxlint';
|
|
153
|
+
|
|
154
|
+
export default defineConfig(oxlintConfig);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Oxfmt:
|
|
158
|
+
|
|
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
|
+
```
|
|
166
|
+
|
|
112
167
|
### Eslint:
|
|
113
168
|
|
|
114
169
|
```ts
|
|
@@ -170,7 +225,7 @@ For example, given the following css file:
|
|
|
170
225
|
@import 'tailwindcss';
|
|
171
226
|
```
|
|
172
227
|
|
|
173
|
-
This
|
|
228
|
+
This could be a minimal version of your Prettier config:
|
|
174
229
|
|
|
175
230
|
```ts
|
|
176
231
|
// prettier.config.mjs
|
package/dist/eslint/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as eslintConfigAstro } from "./astro";
|
|
2
2
|
export { default as eslintConfigBase } from "./base";
|
|
3
|
+
export { default as eslintConfigBetterTailwindcss } from "./better-tailwindcss";
|
|
3
4
|
export { eslintConfig } from "./config";
|
|
4
5
|
export { default as eslintConfigDefaultProject } from "./default-project";
|
|
5
6
|
export { default as eslintConfigFunctional } from "./functional";
|
package/dist/eslint/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"eslint-plugin-astro";var s=[...a.configs.recommended],p=s;import l from"@eslint/js";import m from"@typescript-eslint/parser";import c from"eslint-plugin-prefer-arrow-functions";import u from"eslint-plugin-unicorn";import f from"globals";import g from"typescript-eslint";var y=[{ignores:["**/dist/","**/node_modules/","**/.git/"]},{files:["**/*.ts","**/*.js","**/*.mjs","**/*.mts","**/*.tsx","**/*.jsx"]},...g.configs.recommendedTypeChecked,l.configs.recommended,u.configs.recommended,{languageOptions:{globals:{...f.nodeBuiltin,...f.browser},parser:m,parserOptions:{projectService:!0}},rules:{"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:!1}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/prefer-nullish-coalescing":"error","no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}]}},{rules:{"unicorn/filename-case":["error",{cases:{kebabCase:!0}}],"unicorn/no-array-for-each":["off"],"unicorn/no-array-reduce":["off"],"unicorn/prevent-abbreviations":["off"]}},{plugins:{"prefer-arrow-functions":c},rules:{"prefer-arrow-functions/prefer-arrow-functions":["error",{returnStyle:"implicit"}]}}],d=y;import n from"eslint-plugin-better-tailwindcss";import{defineConfig as C}from"eslint/config";var x=C([{plugins:{"better-tailwindcss":n},rules:{...n.configs["recommended-error"].rules,"better-tailwindcss/enforce-consistent-line-wrapping":"off"}}]),A=x;var j=(t)=>t;var P=(t)=>{let o=Array.isArray(t)?{allowDefaultProject:t}:t;return o.allowDefaultProject.length===0?[]:[{languageOptions:{parserOptions:{projectService:{allowDefaultProject:o.allowDefaultProject,...o.defaultProject&&{defaultProject:o.defaultProject}}}}}]},D=P;import e from"eslint-plugin-functional";var w=[e.configs.externalTypeScriptRecommended,e.configs.recommended,e.configs.stylistic,{rules:{"functional/no-expression-statements":["off"],"functional/no-return-void":["off"]}}],R=w;import r from"@next/eslint-plugin-next";var B=[{ignores:["**/next-env.d.ts"]},{plugins:{"@next/next":r},rules:{...r.configs.recommended.rules,...r.configs["core-web-vitals"].rules}}],N=B;import O from"eslint-plugin-oxlint";var k=[...O.configs["flat/recommended"]],v=k;import L from"eslint-plugin-perfectionist";var S=[L.configs["recommended-natural"],{rules:{"perfectionist/sort-object-types":["warn",{partitionByNewLine:!0}],"perfectionist/sort-objects":["warn",{partitionByNewLine:!0}]}}],H=S;import J from"@stylistic/eslint-plugin";import q from"eslint-plugin-prettier/recommended";var z=[q,{plugins:{"@stylistic":J},rules:{"@stylistic/quotes":["warn","backtick",{avoidEscape:!0}],"prettier/prettier":"warn"}}],E=z;import i from"eslint-plugin-react";import F from"eslint-plugin-react-hooks";import{defineConfig as G}from"eslint/config";var K=G([i.configs.flat.recommended,i.configs.flat["jsx-runtime"],F.configs.flat["recommended-latest"],{settings:{react:{version:"detect"}}}]),M=K;import Q from"eslint-plugin-no-relative-import-paths";var T=[{plugins:{"no-relative-import-paths":Q},rules:{"no-relative-import-paths/no-relative-import-paths":["error",{prefix:"@"}]}}],V=T;import W from"eslint-plugin-solid/configs/typescript";var X=[W],Y=X;import Z from"eslint-plugin-turbo";var _=[Z.configs["flat/recommended"]],$=_;export{$ as eslintConfigTurbo,Y as eslintConfigSolid,V as eslintConfigRelative,M as eslintConfigReact,E as eslintConfigPrettier,H as eslintConfigPerfectionist,v as eslintConfigOxlint,N as eslintConfigNext,R as eslintConfigFunctional,D as eslintConfigDefaultProject,A as eslintConfigBetterTailwindcss,d as eslintConfigBase,p as eslintConfigAstro,j as eslintConfig};
|
|
@@ -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,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "always",
|
|
3
|
+
"bracketSameLine": false,
|
|
4
|
+
"bracketSpacing": true,
|
|
5
|
+
"jsxSingleQuote": true,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": true,
|
|
8
|
+
"tabWidth": 2,
|
|
9
|
+
"trailingComma": "all",
|
|
10
|
+
"useTabs": false,
|
|
11
|
+
"sortImports": {
|
|
12
|
+
"newlinesBetween": true
|
|
13
|
+
},
|
|
14
|
+
"sortTailwindcss": {
|
|
15
|
+
"functions": ["cva", "clsx", "cn"]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -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};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error",
|
|
5
|
+
"suspicious": "warn"
|
|
6
|
+
},
|
|
7
|
+
"plugins": [
|
|
8
|
+
"typescript",
|
|
9
|
+
"unicorn",
|
|
10
|
+
"oxc",
|
|
11
|
+
"import",
|
|
12
|
+
"react",
|
|
13
|
+
"react-perf",
|
|
14
|
+
"nextjs",
|
|
15
|
+
"promise",
|
|
16
|
+
"node",
|
|
17
|
+
"jsx-a11y"
|
|
18
|
+
],
|
|
19
|
+
"env": {
|
|
20
|
+
"es6": true,
|
|
21
|
+
"browser": true,
|
|
22
|
+
"node": true
|
|
23
|
+
},
|
|
24
|
+
"ignorePatterns": ["**/dist/", "**/node_modules/", "**/.git/"],
|
|
25
|
+
"options": {
|
|
26
|
+
"typeAware": true,
|
|
27
|
+
"typeCheck": true
|
|
28
|
+
},
|
|
29
|
+
"rules": {
|
|
30
|
+
"typescript/no-misused-promises": ["error", { "checksVoidReturn": false }],
|
|
31
|
+
"no-unused-vars": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
"args": "all",
|
|
35
|
+
"argsIgnorePattern": "^_",
|
|
36
|
+
"caughtErrors": "all",
|
|
37
|
+
"caughtErrorsIgnorePattern": "^_",
|
|
38
|
+
"destructuredArrayIgnorePattern": "^_",
|
|
39
|
+
"ignoreRestSiblings": true,
|
|
40
|
+
"varsIgnorePattern": "^_"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"typescript/prefer-nullish-coalescing": "error",
|
|
44
|
+
"unicorn/filename-case": ["error", { "cases": { "kebabCase": true } }],
|
|
45
|
+
"unicorn/no-array-for-each": "off",
|
|
46
|
+
"unicorn/no-array-reduce": "off"
|
|
47
|
+
}
|
|
48
|
+
}
|
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",
|
|
@@ -28,6 +28,28 @@
|
|
|
28
28
|
"default": "./dist/prettier/index.mjs",
|
|
29
29
|
"types": "./dist/prettier/index.d.ts"
|
|
30
30
|
}
|
|
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
|
+
},
|
|
44
|
+
"./oxlintrc": {
|
|
45
|
+
"import": {
|
|
46
|
+
"default": "./dist/oxlintrc.json"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./oxfmtrc": {
|
|
50
|
+
"import": {
|
|
51
|
+
"default": "./dist/oxfmtrc.json"
|
|
52
|
+
}
|
|
31
53
|
}
|
|
32
54
|
},
|
|
33
55
|
"files": [
|
|
@@ -36,9 +58,13 @@
|
|
|
36
58
|
"dependencies": {
|
|
37
59
|
"@eslint/compat": "^2.0.0",
|
|
38
60
|
"@eslint/js": "^9.39.2",
|
|
61
|
+
"@next/eslint-plugin-next": "^16.1.1",
|
|
39
62
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
40
63
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
|
64
|
+
"eslint": "^9.39.2",
|
|
41
65
|
"eslint-config-prettier": "^10.1.8",
|
|
66
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
67
|
+
"eslint-plugin-better-tailwindcss": "^4.0.1",
|
|
42
68
|
"eslint-plugin-functional": "^9.0.2",
|
|
43
69
|
"eslint-plugin-import": "^2.32.0",
|
|
44
70
|
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
@@ -46,19 +72,16 @@
|
|
|
46
72
|
"eslint-plugin-perfectionist": "^5.1.0",
|
|
47
73
|
"eslint-plugin-prefer-arrow-functions": "^3.9.1",
|
|
48
74
|
"eslint-plugin-prettier": "^5.5.4",
|
|
49
|
-
"eslint-plugin-unicorn": "^62.0.0",
|
|
50
|
-
"jiti": "^2.6.1",
|
|
51
|
-
"lodash": "^4.17.21",
|
|
52
|
-
"prettier-plugin-tailwindcss": "0.7.2",
|
|
53
|
-
"@next/eslint-plugin-next": "^16.1.1",
|
|
54
|
-
"eslint": "^9.39.2",
|
|
55
|
-
"eslint-plugin-astro": "^1.5.0",
|
|
56
75
|
"eslint-plugin-react": "^7.37.5",
|
|
57
76
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
58
77
|
"eslint-plugin-solid": "^0.14.5",
|
|
59
78
|
"eslint-plugin-turbo": "^2.7.2",
|
|
79
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
80
|
+
"jiti": "^2.6.1",
|
|
81
|
+
"lodash": "^4.17.21",
|
|
60
82
|
"prettier": "^3.7.4",
|
|
61
83
|
"prettier-plugin-astro": "^0.14.1",
|
|
84
|
+
"prettier-plugin-tailwindcss": "0.7.2",
|
|
62
85
|
"typescript-eslint": "^8.50.1"
|
|
63
86
|
},
|
|
64
87
|
"devDependencies": {
|