@vijayhardaha/dev-config 1.1.2 → 1.1.4
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 +9 -9
- package/package.json +8 -9
- package/src/eslint/lib/build-config.js +6 -1
- package/src/eslint/lib/rules.js +9 -1
- package/src/prettier/index.js +1 -1
package/README.md
CHANGED
|
@@ -19,13 +19,13 @@ Reusable development configuration package for Next.js + TypeScript projects.
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
bun install @vijayhardaha/dev-config --
|
|
22
|
+
bun install @vijayhardaha/dev-config --dev
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### Install Required Packages
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
bun add --
|
|
28
|
+
bun add --dev eslint@9.39.4 @eslint/js@9.39.4 prettier @prettier/plugin-xml @eslint/compat @eslint/eslintrc eslint-config-prettier eslint-plugin-prettier globals eslint-plugin-jsdoc eslint-plugin-import eslint-import-resolver-typescript typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### Install Optional Packages
|
|
@@ -33,43 +33,43 @@ bun add --save-dev eslint@9.39.4 @eslint/js@9.39.4 prettier @prettier/plugin-xml
|
|
|
33
33
|
### Typescript
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
bun add --
|
|
36
|
+
bun add --dev typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### Prettier
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
bun add --
|
|
42
|
+
bun add --dev prettier @prettier/plugin-xml
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
#### Stylelint
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
bun add --
|
|
48
|
+
bun add --dev stylelint stylelint-config-property-sort-order-smacss stylelint-config-standard-scss stylelint-order
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
#### React
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
bun add --
|
|
54
|
+
bun add --dev eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
#### Next.js
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
bun add --
|
|
60
|
+
bun add --dev @next/eslint-plugin-next@15.5.15 eslint-config-next@15.5.15
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
#### Commitlint
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
bun add --
|
|
66
|
+
bun add --dev husky @commitlint/cli @commitlint/config-conventional @commitlint/types
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
#### Next Sitemap
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
bun add --
|
|
72
|
+
bun add --dev next-sitemap
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
## Quick Start
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vijayhardaha/dev-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Reusable development configurations for Next.js + TypeScript projects",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint .",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"test": "vitest run",
|
|
13
13
|
"test:watch": "vitest",
|
|
14
14
|
"test:coverage": "vitest run --coverage",
|
|
15
|
-
"gc": "read -p 'Execute git commands from .tmp/git.txt? [Y/n] ' ans; [ \"$ans\" = \"n\" ] || [ \"$ans\" = \"N\" ] && echo 'Aborted.' || source .tmp/git.txt",
|
|
16
15
|
"prepare": "husky"
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
@@ -59,22 +58,22 @@
|
|
|
59
58
|
"typescript"
|
|
60
59
|
],
|
|
61
60
|
"devDependencies": {
|
|
62
|
-
"@commitlint/cli": "^
|
|
63
|
-
"@commitlint/config-conventional": "^
|
|
64
|
-
"@commitlint/types": "^
|
|
61
|
+
"@commitlint/cli": "^21.0.1",
|
|
62
|
+
"@commitlint/config-conventional": "^21.0.1",
|
|
63
|
+
"@commitlint/types": "^21.0.1",
|
|
65
64
|
"@prettier/plugin-xml": "^3.4.2",
|
|
66
|
-
"@vitest/coverage-v8": "^4.1.
|
|
65
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
67
66
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
68
67
|
"eslint-plugin-react": "^7.37.5",
|
|
69
68
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
70
69
|
"next-sitemap": "^4.2.3",
|
|
71
70
|
"release-it": "^20.0.1",
|
|
72
|
-
"stylelint": "^17.
|
|
71
|
+
"stylelint": "^17.12.0",
|
|
73
72
|
"stylelint-config-property-sort-order-smacss": "^11.2.0",
|
|
74
73
|
"stylelint-config-standard-scss": "^17.0.0",
|
|
75
74
|
"stylelint-order": "^8.1.1",
|
|
76
75
|
"typescript": "^6.0.3",
|
|
77
|
-
"vitest": "^4.1.
|
|
76
|
+
"vitest": "^4.1.7"
|
|
78
77
|
},
|
|
79
78
|
"peerDependencies": {
|
|
80
79
|
"@eslint/compat": ">=2",
|
|
@@ -91,7 +90,7 @@
|
|
|
91
90
|
"eslint": ">=9",
|
|
92
91
|
"globals": ">=17",
|
|
93
92
|
"husky": ">=9",
|
|
94
|
-
"prettier": "
|
|
93
|
+
"prettier": "^3.8.3",
|
|
95
94
|
"typescript": ">=6"
|
|
96
95
|
},
|
|
97
96
|
"peerDependenciesMeta": {
|
|
@@ -73,7 +73,12 @@ export const buildConfig = ({
|
|
|
73
73
|
...languageOptions,
|
|
74
74
|
...(typescript && { parserOptions: { tsconfigRootDir: process.cwd(), ...parserOptions } }),
|
|
75
75
|
},
|
|
76
|
-
settings: {
|
|
76
|
+
settings: {
|
|
77
|
+
...(importOrder && { 'import/resolver': { typescript: {} } }),
|
|
78
|
+
...(jsdoc && { jsdoc: { mode: 'typescript' } }),
|
|
79
|
+
...extraSettings,
|
|
80
|
+
...settings,
|
|
81
|
+
},
|
|
77
82
|
rules: { ...commonRules({ prettier, importOrder, typescript, jsdoc }), ...extraRules, ...rules },
|
|
78
83
|
...extend,
|
|
79
84
|
};
|
package/src/eslint/lib/rules.js
CHANGED
|
@@ -53,7 +53,15 @@ const jsdocRules = (jsdoc = true) =>
|
|
|
53
53
|
// Optional but powerful for large teams
|
|
54
54
|
'jsdoc/sort-tags': [
|
|
55
55
|
'warn',
|
|
56
|
-
{
|
|
56
|
+
{
|
|
57
|
+
tagSequence: [
|
|
58
|
+
{ tags: ['description'] },
|
|
59
|
+
{ tags: ['template'] },
|
|
60
|
+
{ tags: ['param'] },
|
|
61
|
+
{ tags: ['returns'] },
|
|
62
|
+
{ tags: ['example'] },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
57
65
|
],
|
|
58
66
|
|
|
59
67
|
// Avoid useless docs
|
package/src/prettier/index.js
CHANGED
|
@@ -39,7 +39,7 @@ const config = {
|
|
|
39
39
|
// Collapse object literals
|
|
40
40
|
objectWrap: 'collapse',
|
|
41
41
|
// Ensures that whitespace in XML is preserved as-is
|
|
42
|
-
xmlWhitespaceSensitivity: '
|
|
42
|
+
xmlWhitespaceSensitivity: 'preserve',
|
|
43
43
|
|
|
44
44
|
// ---- Plugins ----
|
|
45
45
|
plugins: ['@prettier/plugin-xml'],
|