@noxickon/codex 1.1.0 → 1.2.1
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 -9
- package/eslint/base.config.js +4 -0
- package/eslint/node.config.js +20 -0
- package/eslint/react.config.js +3 -10
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ npm install --save-dev \
|
|
|
24
24
|
eslint-config-prettier \
|
|
25
25
|
eslint-plugin-unicorn \
|
|
26
26
|
eslint-plugin-perfectionist \
|
|
27
|
+
eslint-plugin-sonarjs \
|
|
28
|
+
eslint-plugin-regexp \
|
|
27
29
|
eslint-plugin-sort-destructure-keys \
|
|
28
30
|
eslint-plugin-unused-imports \
|
|
29
31
|
prettier-plugin-tailwindcss
|
|
@@ -34,12 +36,18 @@ npm install --save-dev \
|
|
|
34
36
|
```bash
|
|
35
37
|
npm install --save-dev \
|
|
36
38
|
eslint-plugin-better-tailwindcss \
|
|
37
|
-
eslint-plugin-jsx-a11y \
|
|
38
39
|
eslint-plugin-react-hooks \
|
|
39
40
|
eslint-plugin-react-compiler \
|
|
40
41
|
eslint-plugin-react-refresh
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
**Node.js projects (additional dependencies):**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install --save-dev \
|
|
48
|
+
eslint-plugin-n
|
|
49
|
+
```
|
|
50
|
+
|
|
43
51
|
### One-command installation (React projects)
|
|
44
52
|
|
|
45
53
|
```bash
|
|
@@ -53,11 +61,12 @@ npm install --save-dev \
|
|
|
53
61
|
eslint-config-prettier \
|
|
54
62
|
eslint-plugin-unicorn \
|
|
55
63
|
eslint-plugin-perfectionist \
|
|
64
|
+
eslint-plugin-sonarjs \
|
|
65
|
+
eslint-plugin-regexp \
|
|
56
66
|
eslint-plugin-sort-destructure-keys \
|
|
57
67
|
eslint-plugin-unused-imports \
|
|
58
68
|
prettier-plugin-tailwindcss \
|
|
59
69
|
eslint-plugin-better-tailwindcss \
|
|
60
|
-
eslint-plugin-jsx-a11y \
|
|
61
70
|
eslint-plugin-react-hooks \
|
|
62
71
|
eslint-plugin-react-compiler \
|
|
63
72
|
eslint-plugin-react-refresh
|
|
@@ -67,7 +76,7 @@ npm install --save-dev \
|
|
|
67
76
|
|
|
68
77
|
### ESLint
|
|
69
78
|
|
|
70
|
-
#####
|
|
79
|
+
##### React projects:
|
|
71
80
|
|
|
72
81
|
###### eslint.config.js
|
|
73
82
|
|
|
@@ -77,6 +86,16 @@ import { createReactConfig } from '@noxickon/codex/eslint/react';
|
|
|
77
86
|
export default createReactConfig();
|
|
78
87
|
```
|
|
79
88
|
|
|
89
|
+
##### Node.js projects:
|
|
90
|
+
|
|
91
|
+
###### eslint.config.js
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
import { createNodeConfig } from '@noxickon/codex/eslint/node';
|
|
95
|
+
|
|
96
|
+
export default createNodeConfig();
|
|
97
|
+
```
|
|
98
|
+
|
|
80
99
|
##### Custom Tailwind CSS path:
|
|
81
100
|
|
|
82
101
|
###### eslint.config.js
|
|
@@ -128,11 +147,12 @@ export default createPrettierConfig({
|
|
|
128
147
|
|
|
129
148
|
## Configuration Options
|
|
130
149
|
|
|
131
|
-
### ESLint (React)
|
|
150
|
+
### ESLint (React / Base)
|
|
132
151
|
|
|
133
152
|
| Option | Type | Default | Description |
|
|
134
153
|
| ------------------ | -------------- | -------------------- | ---------------------------------------------------------------- |
|
|
135
154
|
| tailwindEntryPoint | string or null | './src/tailwind.css' | Path to your Tailwind CSS file. Set to null to disable Tailwind. |
|
|
155
|
+
| enableTailwind | boolean | true | Enable or disable the Tailwind CSS plugin. |
|
|
136
156
|
|
|
137
157
|
### Prettier
|
|
138
158
|
|
|
@@ -145,18 +165,28 @@ export default createPrettierConfig({
|
|
|
145
165
|
|
|
146
166
|
### ESLint
|
|
147
167
|
|
|
168
|
+
**Base (all projects):**
|
|
169
|
+
|
|
148
170
|
- TypeScript ESLint
|
|
149
|
-
- React Hooks
|
|
150
|
-
- React Compiler
|
|
151
|
-
- React Refresh (Vite)
|
|
152
|
-
- JSX Accessibility (a11y)
|
|
153
171
|
- Unicorn (Modern JS/TS best practices)
|
|
172
|
+
- SonarJS (Code smells and bug detection)
|
|
173
|
+
- RegExp (Static RegExp analysis)
|
|
154
174
|
- Perfectionist (Auto-sorting)
|
|
155
|
-
- Better Tailwind CSS
|
|
156
175
|
- Unused Imports
|
|
157
176
|
- Sort Destructure Keys
|
|
158
177
|
- ESLint Config Prettier (Disables ESLint rules that conflict with Prettier)
|
|
159
178
|
|
|
179
|
+
**React (additional):**
|
|
180
|
+
|
|
181
|
+
- React Hooks
|
|
182
|
+
- React Compiler
|
|
183
|
+
- React Refresh (Vite)
|
|
184
|
+
- Better Tailwind CSS
|
|
185
|
+
|
|
186
|
+
**Node.js (additional):**
|
|
187
|
+
|
|
188
|
+
- eslint-plugin-n (Node.js best practices, deprecated APIs, missing imports)
|
|
189
|
+
|
|
160
190
|
### Prettier
|
|
161
191
|
|
|
162
192
|
- Prettier Plugin Tailwind CSS
|
package/eslint/base.config.js
CHANGED
|
@@ -11,6 +11,8 @@ import js from '@eslint/js';
|
|
|
11
11
|
import prettierConfig from 'eslint-config-prettier';
|
|
12
12
|
import betterTailwind from 'eslint-plugin-better-tailwindcss';
|
|
13
13
|
import perfectionist from 'eslint-plugin-perfectionist';
|
|
14
|
+
import regexp from 'eslint-plugin-regexp';
|
|
15
|
+
import sonarjs from 'eslint-plugin-sonarjs';
|
|
14
16
|
import sortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
|
|
15
17
|
import unicorn from 'eslint-plugin-unicorn';
|
|
16
18
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
@@ -40,6 +42,8 @@ export function createBaseConfig(options = {}) {
|
|
|
40
42
|
},
|
|
41
43
|
js.configs.recommended,
|
|
42
44
|
...tseslint.configs.recommended,
|
|
45
|
+
sonarjs.configs.recommended,
|
|
46
|
+
regexp.configs['flat/recommended'],
|
|
43
47
|
prettierConfig,
|
|
44
48
|
{
|
|
45
49
|
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js ESLint configuration extending base config
|
|
3
|
+
* @param {Object} options - Configuration options
|
|
4
|
+
* @returns {Array} ESLint flat config array
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import nodePlugin from 'eslint-plugin-n';
|
|
8
|
+
|
|
9
|
+
import { createBaseConfig } from './base.config.js';
|
|
10
|
+
|
|
11
|
+
export function createNodeConfig(options = {}) {
|
|
12
|
+
const baseConfig = createBaseConfig({ ...options, enableTailwind: false });
|
|
13
|
+
|
|
14
|
+
const nodeConfig = {
|
|
15
|
+
files: ['**/*.{ts,js}'],
|
|
16
|
+
...nodePlugin.configs['flat/recommended-module'],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return [...baseConfig, nodeConfig];
|
|
20
|
+
}
|
package/eslint/react.config.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* @returns {Array} ESLint flat config array
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
10
9
|
import perfectionist from 'eslint-plugin-perfectionist';
|
|
11
10
|
import reactCompiler from 'eslint-plugin-react-compiler';
|
|
12
11
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
@@ -20,7 +19,6 @@ export function createReactConfig(options = {}) {
|
|
|
20
19
|
const reactConfig = {
|
|
21
20
|
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
22
21
|
plugins: {
|
|
23
|
-
'jsx-a11y': jsxA11y,
|
|
24
22
|
perfectionist,
|
|
25
23
|
'react-compiler': reactCompiler,
|
|
26
24
|
'react-hooks': reactHooks,
|
|
@@ -52,16 +50,11 @@ export function createReactConfig(options = {}) {
|
|
|
52
50
|
],
|
|
53
51
|
},
|
|
54
52
|
],
|
|
55
|
-
|
|
56
|
-
// Accessibility - important for UI library!
|
|
57
|
-
'jsx-a11y/alt-text': 'warn',
|
|
58
|
-
'jsx-a11y/aria-props': 'warn',
|
|
59
|
-
'jsx-a11y/aria-proptypes': 'warn',
|
|
60
|
-
'jsx-a11y/aria-unsupported-elements': 'warn',
|
|
61
|
-
'jsx-a11y/role-has-required-aria-props': 'warn',
|
|
62
|
-
'jsx-a11y/role-supports-aria-props': 'warn',
|
|
63
53
|
},
|
|
64
54
|
};
|
|
65
55
|
|
|
66
56
|
return [...baseConfig, reactConfig];
|
|
67
57
|
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxickon/codex",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"author": "noxickon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Shared ESLint & Prettier configuration for noxickon projects",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
"./prettier": "./prettier.config.js",
|
|
13
13
|
"./eslint/base": "./eslint/base.config.js",
|
|
14
|
+
"./eslint/node": "./eslint/node.config.js",
|
|
14
15
|
"./eslint/react": "./eslint/react.config.js"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
@@ -27,11 +28,13 @@
|
|
|
27
28
|
"eslint": "^10.0.0",
|
|
28
29
|
"eslint-config-prettier": "^10.0.0",
|
|
29
30
|
"eslint-plugin-better-tailwindcss": "^4.0.0",
|
|
30
|
-
"eslint-plugin-
|
|
31
|
+
"eslint-plugin-n": "^17.0.0",
|
|
31
32
|
"eslint-plugin-perfectionist": "^5.6.0",
|
|
33
|
+
"eslint-plugin-regexp": "^3.0.0",
|
|
32
34
|
"eslint-plugin-react-compiler": "*",
|
|
33
35
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
34
36
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
37
|
+
"eslint-plugin-sonarjs": "^4.0.0",
|
|
35
38
|
"eslint-plugin-sort-destructure-keys": "^3.0.0",
|
|
36
39
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
37
40
|
"eslint-plugin-unused-imports": "^4.0.0",
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
"eslint-plugin-better-tailwindcss": {
|
|
45
48
|
"optional": true
|
|
46
49
|
},
|
|
47
|
-
"eslint-plugin-
|
|
50
|
+
"eslint-plugin-n": {
|
|
48
51
|
"optional": true
|
|
49
52
|
},
|
|
50
53
|
"eslint-plugin-react-hooks": {
|