@hiddenability/opinionated-defaults 0.1.46 → 0.1.49
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 +39 -2
- package/dist/eslint/better-tailwindcss.d.ts +3 -0
- package/dist/eslint/default-project.d.ts +5 -1
- package/dist/eslint/index.d.ts +1 -0
- package/dist/eslint/index.mjs +1 -1
- package/dist/oxfmtrc.json +17 -0
- package/dist/oxlintrc.json +47 -0
- package/package.json +25 -14
package/README.md
CHANGED
|
@@ -29,11 +29,11 @@ This package contains a CLI that can be used to generate both eslint.config.ts a
|
|
|
29
29
|
|
|
30
30
|
You can use it by running one of the following commands.
|
|
31
31
|
|
|
32
|
-
```
|
|
32
|
+
```sh
|
|
33
33
|
bunx @hiddenability/opinionated-defaults
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
```
|
|
36
|
+
```sh
|
|
37
37
|
npx @hiddenability/opinionated-defaults
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -75,6 +75,26 @@ npx @hiddenability/opinionated-defaults
|
|
|
75
75
|
- [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
|
|
76
76
|
- [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
77
77
|
|
|
78
|
+
### Oxlint:
|
|
79
|
+
|
|
80
|
+
#### Enabled plugins:
|
|
81
|
+
|
|
82
|
+
- typescript
|
|
83
|
+
- unicorn
|
|
84
|
+
- oxc
|
|
85
|
+
- import
|
|
86
|
+
- react
|
|
87
|
+
- react-perf
|
|
88
|
+
- nextjs
|
|
89
|
+
- promise
|
|
90
|
+
- node
|
|
91
|
+
- jsx-a11y
|
|
92
|
+
|
|
93
|
+
### Oxfmt:
|
|
94
|
+
|
|
95
|
+
- Import sorting (with newlines between groups)
|
|
96
|
+
- Tailwind CSS class sorting (supports `cva`, `clsx`, `cn`)
|
|
97
|
+
|
|
78
98
|
### Prettier:
|
|
79
99
|
|
|
80
100
|
- Astro
|
|
@@ -109,6 +129,23 @@ npm i @hiddenability/opinionated-defaults -D
|
|
|
109
129
|
|
|
110
130
|
## Usage:
|
|
111
131
|
|
|
132
|
+
### Oxlint:
|
|
133
|
+
|
|
134
|
+
Extend the config in your `.oxlintrc.json`:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"extends": [
|
|
139
|
+
"./node_modules/@hiddenability/opinionated-defaults/dist/oxlintrc.json"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Oxfmt:
|
|
145
|
+
|
|
146
|
+
> [!NOTE]
|
|
147
|
+
> Oxfmt does not yet support an `extends` field ([see here](https://github.com/oxc-project/oxc/issues/16394)), so the config must be copied into the project config location.
|
|
148
|
+
|
|
112
149
|
### Eslint:
|
|
113
150
|
|
|
114
151
|
```ts
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { ConfigArray } from "typescript-eslint";
|
|
2
|
-
|
|
2
|
+
type DefaultProjectOptions = {
|
|
3
|
+
allowDefaultProject: string[];
|
|
4
|
+
defaultProject?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const eslintConfigDefaultProject: (filesOrOptions: DefaultProjectOptions | string[]) => ConfigArray;
|
|
3
7
|
export default eslintConfigDefaultProject;
|
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,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,47 @@
|
|
|
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
|
+
},
|
|
28
|
+
"rules": {
|
|
29
|
+
"typescript/no-misused-promises": ["error", { "checksVoidReturn": false }],
|
|
30
|
+
"no-unused-vars": [
|
|
31
|
+
"error",
|
|
32
|
+
{
|
|
33
|
+
"args": "all",
|
|
34
|
+
"argsIgnorePattern": "^_",
|
|
35
|
+
"caughtErrors": "all",
|
|
36
|
+
"caughtErrorsIgnorePattern": "^_",
|
|
37
|
+
"destructuredArrayIgnorePattern": "^_",
|
|
38
|
+
"ignoreRestSiblings": true,
|
|
39
|
+
"varsIgnorePattern": "^_"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"typescript/prefer-nullish-coalescing": "error",
|
|
43
|
+
"unicorn/filename-case": ["error", { "cases": { "kebabCase": true } }],
|
|
44
|
+
"unicorn/no-array-for-each": "off",
|
|
45
|
+
"unicorn/no-array-reduce": "off"
|
|
46
|
+
}
|
|
47
|
+
}
|
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.49",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
"default": "./dist/prettier/index.mjs",
|
|
29
29
|
"types": "./dist/prettier/index.d.ts"
|
|
30
30
|
}
|
|
31
|
+
},
|
|
32
|
+
"./oxlintrc": {
|
|
33
|
+
"import": {
|
|
34
|
+
"default": "./dist/oxlintrc.json"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./oxfmtrc": {
|
|
38
|
+
"import": {
|
|
39
|
+
"default": "./dist/oxfmtrc.json"
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
},
|
|
33
43
|
"files": [
|
|
@@ -36,9 +46,13 @@
|
|
|
36
46
|
"dependencies": {
|
|
37
47
|
"@eslint/compat": "^2.0.0",
|
|
38
48
|
"@eslint/js": "^9.39.2",
|
|
49
|
+
"@next/eslint-plugin-next": "^16.1.1",
|
|
39
50
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
40
51
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
|
52
|
+
"eslint": "^9.39.2",
|
|
41
53
|
"eslint-config-prettier": "^10.1.8",
|
|
54
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
55
|
+
"eslint-plugin-better-tailwindcss": "^4.0.1",
|
|
42
56
|
"eslint-plugin-functional": "^9.0.2",
|
|
43
57
|
"eslint-plugin-import": "^2.32.0",
|
|
44
58
|
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
@@ -46,19 +60,16 @@
|
|
|
46
60
|
"eslint-plugin-perfectionist": "^5.1.0",
|
|
47
61
|
"eslint-plugin-prefer-arrow-functions": "^3.9.1",
|
|
48
62
|
"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
63
|
"eslint-plugin-react": "^7.37.5",
|
|
57
64
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
58
65
|
"eslint-plugin-solid": "^0.14.5",
|
|
59
66
|
"eslint-plugin-turbo": "^2.7.2",
|
|
67
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
68
|
+
"jiti": "^2.6.1",
|
|
69
|
+
"lodash": "^4.17.21",
|
|
60
70
|
"prettier": "^3.7.4",
|
|
61
71
|
"prettier-plugin-astro": "^0.14.1",
|
|
72
|
+
"prettier-plugin-tailwindcss": "0.7.2",
|
|
62
73
|
"typescript-eslint": "^8.50.1"
|
|
63
74
|
},
|
|
64
75
|
"devDependencies": {
|
|
@@ -71,11 +82,11 @@
|
|
|
71
82
|
"oxc-transform": "^0.105.0"
|
|
72
83
|
},
|
|
73
84
|
"optionalDependencies": {
|
|
74
|
-
"@hiddenability/opinionated-defaults-darwin-arm64": "
|
|
75
|
-
"@hiddenability/opinionated-defaults-darwin-x64": "
|
|
76
|
-
"@hiddenability/opinionated-defaults-linux-arm64": "
|
|
77
|
-
"@hiddenability/opinionated-defaults-linux-x64": "
|
|
78
|
-
"@hiddenability/opinionated-defaults-win-arm64": "
|
|
79
|
-
"@hiddenability/opinionated-defaults-win-x64": "
|
|
85
|
+
"@hiddenability/opinionated-defaults-darwin-arm64": "latest",
|
|
86
|
+
"@hiddenability/opinionated-defaults-darwin-x64": "latest",
|
|
87
|
+
"@hiddenability/opinionated-defaults-linux-arm64": "latest",
|
|
88
|
+
"@hiddenability/opinionated-defaults-linux-x64": "latest",
|
|
89
|
+
"@hiddenability/opinionated-defaults-win-arm64": "latest",
|
|
90
|
+
"@hiddenability/opinionated-defaults-win-x64": "latest"
|
|
80
91
|
}
|
|
81
92
|
}
|