@nelsonlaidev/oxlint-config 0.1.0
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 +56 -0
- package/dist/index.d.mts +145 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1272 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nelson Lai
|
|
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
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @nelsonlaidev/oxlint-config
|
|
2
|
+
|
|
3
|
+
Personal Oxlint configurations for Nelson Lai projects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -D @nelsonlaidev/oxlint-config oxlint
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Create an `oxlint.config.ts` file with the following content:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { defineConfig } from '@nelsonlaidev/oxlint-config'
|
|
15
|
+
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
// Custom OxLint configuration options
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Notes
|
|
22
|
+
|
|
23
|
+
If you are using pnpm, add the following to your `.npmrc` to hoist ESLint plugin dependencies so the Oxc VS Code extension can resolve them:
|
|
24
|
+
|
|
25
|
+
```ini
|
|
26
|
+
public-hoist-pattern[]=*eslint-plugin*
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### What's Included
|
|
30
|
+
|
|
31
|
+
This config includes opinionated rules from the following plugins:
|
|
32
|
+
|
|
33
|
+
#### Always enabled
|
|
34
|
+
|
|
35
|
+
- `oxc`
|
|
36
|
+
- `eslint`
|
|
37
|
+
- `typescript`
|
|
38
|
+
- `unicorn`
|
|
39
|
+
- `promise`
|
|
40
|
+
- `node`
|
|
41
|
+
- `jsx-a11y`
|
|
42
|
+
- `import` / `import-sort`
|
|
43
|
+
- `jsdoc`
|
|
44
|
+
- `stylistic`
|
|
45
|
+
- `de-morgan`
|
|
46
|
+
- `zod`
|
|
47
|
+
- `regexp`
|
|
48
|
+
- `sonarjs`
|
|
49
|
+
|
|
50
|
+
#### Conditionally enabled
|
|
51
|
+
|
|
52
|
+
- `react` — auto-detected or via `react` option
|
|
53
|
+
- `nextjs` — auto-detected or via `nextjs` option
|
|
54
|
+
- `vitest` — via `vitest` option
|
|
55
|
+
- `playwright` — via `playwright` option
|
|
56
|
+
- `tailwindcss` — via `tailwindcss` option
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Selectors } from "eslint-plugin-better-tailwindcss/types";
|
|
2
|
+
import { OxlintConfig, OxlintOverride } from "oxlint";
|
|
3
|
+
|
|
4
|
+
//#region src/types/playwright.d.ts
|
|
5
|
+
type PlaywrightConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* A list of glob patterns for your Playwright test files.
|
|
8
|
+
*/
|
|
9
|
+
files: OxlintOverride['files'];
|
|
10
|
+
/**
|
|
11
|
+
* See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionnames) for more details.
|
|
12
|
+
* @default []
|
|
13
|
+
*/
|
|
14
|
+
assertFunctionNames?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionpatterns) for more details.
|
|
17
|
+
* @default []
|
|
18
|
+
*/
|
|
19
|
+
assertFunctionPatterns?: string[];
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/types/tailwindcss.d.ts
|
|
23
|
+
type TailwindCSSConfig = {
|
|
24
|
+
/**
|
|
25
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#entrypoint) for more details.
|
|
26
|
+
*/
|
|
27
|
+
entryPoint?: string;
|
|
28
|
+
/**
|
|
29
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tailwindconfig) for more details.
|
|
30
|
+
*/
|
|
31
|
+
tailwindConfig?: string;
|
|
32
|
+
/**
|
|
33
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tsconfig) for more details.
|
|
34
|
+
*/
|
|
35
|
+
tsconfig?: string;
|
|
36
|
+
/**
|
|
37
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#detectcomponentclasses) for more details.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
detectComponentClasses?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#rootfontsize) for more details.
|
|
43
|
+
* @default 16
|
|
44
|
+
*/
|
|
45
|
+
rootFontSize?: number;
|
|
46
|
+
/**
|
|
47
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#messagestyle) for more details.
|
|
48
|
+
*/
|
|
49
|
+
messageStyle?: 'visual' | 'compact' | 'raw';
|
|
50
|
+
/**
|
|
51
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#selectors) for more details.
|
|
52
|
+
*/
|
|
53
|
+
selectors?: Selectors;
|
|
54
|
+
canonical?: {
|
|
55
|
+
/**
|
|
56
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#collapse) for more details.
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
collapse?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#logical) for more details.
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
logical?: boolean;
|
|
65
|
+
};
|
|
66
|
+
classOrder?: {
|
|
67
|
+
/**
|
|
68
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#order) for more details.
|
|
69
|
+
* @default 'official'
|
|
70
|
+
*/
|
|
71
|
+
order?: 'asc' | 'desc' | 'official' | 'strict';
|
|
72
|
+
/**
|
|
73
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassOrder) for more details.
|
|
74
|
+
* @default 'preserve'
|
|
75
|
+
*/
|
|
76
|
+
componentOrder?: 'asc' | 'desc' | 'preserve';
|
|
77
|
+
/**
|
|
78
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassPosition) for more details.
|
|
79
|
+
* @default 'start'
|
|
80
|
+
*/
|
|
81
|
+
componentPosition?: 'start' | 'end';
|
|
82
|
+
/**
|
|
83
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassOrder) for more details.
|
|
84
|
+
* @default 'preserve'
|
|
85
|
+
*/
|
|
86
|
+
unknownOrder?: 'asc' | 'desc' | 'preserve';
|
|
87
|
+
/**
|
|
88
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassPosition) for more details.
|
|
89
|
+
* @default 'start'
|
|
90
|
+
*/
|
|
91
|
+
unknownPosition?: 'start' | 'end';
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md#restrict) for more details.
|
|
95
|
+
* @default []
|
|
96
|
+
*/
|
|
97
|
+
restrict?: string[] | Array<{
|
|
98
|
+
pattern: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
fix?: string;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md#ignore) for more details.
|
|
104
|
+
* @default []
|
|
105
|
+
*/
|
|
106
|
+
ignore?: string[];
|
|
107
|
+
whitespace?: {
|
|
108
|
+
/**
|
|
109
|
+
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md#allowMultiline) for more details.
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
allowMultiline?: boolean;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/types/vitest.d.ts
|
|
117
|
+
type VitestConfig = {
|
|
118
|
+
/**
|
|
119
|
+
* A list of glob patterns for your Vitest test files.
|
|
120
|
+
*/
|
|
121
|
+
files: OxlintOverride['files'];
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/types/config.d.ts
|
|
125
|
+
type CustomConfig = {
|
|
126
|
+
nextjs?: boolean;
|
|
127
|
+
react?: boolean;
|
|
128
|
+
tailwindcss?: TailwindCSSConfig;
|
|
129
|
+
vitest?: VitestConfig;
|
|
130
|
+
playwright?: PlaywrightConfig;
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/base.d.ts
|
|
134
|
+
declare const defineConfig: (config?: OxlintConfig, userConfig?: CustomConfig) => OxlintConfig;
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/globs.d.ts
|
|
137
|
+
declare const GLOB_SRC_EXT = "{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
|
|
138
|
+
declare const GLOB_SRC = "**/*.{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
|
|
139
|
+
declare const GLOB_JS = "**/*.{js,cjs,mjs}";
|
|
140
|
+
declare const GLOB_JSX = "**/*.{jsx,cjsx,mjsx}";
|
|
141
|
+
declare const GLOB_TS = "**/*.{ts,cts,mts}";
|
|
142
|
+
declare const GLOB_TSX = "**/*.{tsx,ctsx,mtsx}";
|
|
143
|
+
//#endregion
|
|
144
|
+
export { CustomConfig, GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, TailwindCSSConfig, defineConfig };
|
|
145
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/playwright.ts","../src/types/tailwindcss.ts","../src/types/vitest.ts","../src/types/config.ts","../src/base.ts","../src/globs.ts"],"mappings":";;;;KAEY,gBAAA;;;AAAZ;EAIE,KAAA,EAAO,cAAA;;;;;EAKP,mBAAA;EAKA;;;;EAAA,sBAAA;AAAA;;;KCdU,iBAAA;;;ADAZ;ECIE,UAAA;;;;EAIA,cAAA;EDCA;;;ECGA,QAAA;;;;AAZF;EAiBE,sBAAA;;;;;EAKA,YAAA;EALA;;;EASA,YAAA;EAIY;;;EAAZ,SAAA,GAAY,SAAA;EAEZ,SAAA;IAkBE;;;;IAbA,QAAA;IAwCF;;;;IAnCE,OAAA;EAAA;EAGF,UAAA;IA6CE;;;;IAxCA,KAAA;;AClDJ;;;IDuDI,cAAA;ICnDmB;;;;IDwDnB,iBAAA;IE1DoB;;;;IF+DpB,YAAA;IE1D2B;;;;IF+D3B,eAAA;EAAA;EEhEF;;;;EFuEA,QAAA,cAAsB,KAAA;IAAQ,OAAA;IAAiB,OAAA;IAAkB,GAAA;EAAA;EGjCtD;;;;EHuCX,MAAA;EAEA,UAAA;IGwDD;;;;IHnDG,cAAA;EAAA;AAAA;;;KC1FQ,YAAA;;;AFAZ;EEIE,KAAA,EAAO,cAAA;AAAA;;;KCFG,YAAA;EACV,MAAA;EACA,KAAA;EACA,WAAA,GAAc,iBAAA;EACd,MAAA,GAAS,YAAA;EACT,UAAA,GAAa,gBAAA;AAAA;;;cCqCF,YAAA,GAAgB,MAAA,GAAQ,YAAA,EAAmB,UAAA,GAAY,YAAA,KAAoB,YAAA;;;cC9C3E,YAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA"}
|