@vortiquo/eslint-config 1.0.2 → 1.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/README.md +1 -1
- package/index.js +2 -0
- package/node-library-js.js +34 -0
- package/package.json +13 -9
- package/react-library-js.js +80 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @vortiquo/eslint-config
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@vortiquo/eslint-config)
|
|
4
|
-
[](https://github.com/vortiquo/
|
|
4
|
+
[](https://github.com/vortiquo/node-eslint-config/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
Modern ESLint v9 flat configurations with TypeScript, React, and Node.js
|
|
7
7
|
support.
|
package/index.js
CHANGED
|
@@ -3,7 +3,9 @@ export { base } from './base.js';
|
|
|
3
3
|
export { baseTypescript } from './base-typescript.js';
|
|
4
4
|
export { react } from './react.js';
|
|
5
5
|
export { reactLibrary } from './react-library.js';
|
|
6
|
+
export { reactLibraryJs } from './react-library-js.js';
|
|
6
7
|
export { nextjs } from './nextjs.js';
|
|
7
8
|
export { server } from './server.js';
|
|
8
9
|
export { nestjs } from './nestjs.js';
|
|
9
10
|
export { nodeLibrary } from './node-library.js';
|
|
11
|
+
export { nodeLibraryJs } from './node-library-js.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import { base } from './base.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ESLint configuration for JavaScript Node.js libraries/packages.
|
|
6
|
+
* For projects without TypeScript - extends base config only.
|
|
7
|
+
*
|
|
8
|
+
* @type {import("eslint").Linter.Config[]}
|
|
9
|
+
*/
|
|
10
|
+
export const nodeLibraryJs = [
|
|
11
|
+
...base,
|
|
12
|
+
{
|
|
13
|
+
name: 'vortiquo/node-library-js',
|
|
14
|
+
languageOptions: {
|
|
15
|
+
globals: {
|
|
16
|
+
...globals.node,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
// No console in libraries (consumers should handle logging)
|
|
21
|
+
'no-console': 'error',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'vortiquo/node-library-js/config-files',
|
|
26
|
+
files: ['**/*.config.{js,mjs,cjs}', '**/.*rc.{js,mjs,cjs}'],
|
|
27
|
+
rules: {
|
|
28
|
+
'import/no-default-export': 'off',
|
|
29
|
+
'no-console': 'off',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export default nodeLibraryJs;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vortiquo/eslint-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Modern ESLint v9 flat configurations with TypeScript, React, Next.js, and Node.js support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Vortiquo <dev@vortiquo.com>",
|
|
8
|
-
"homepage": "https://github.com/vortiquo/eslint-config#readme",
|
|
8
|
+
"homepage": "https://github.com/vortiquo/node-eslint-config#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/vortiquo/eslint-config"
|
|
11
|
+
"url": "https://github.com/vortiquo/node-eslint-config"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"lint": "ls-lint",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepare": "husky"
|
|
19
19
|
},
|
|
20
20
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/vortiquo/eslint-config/issues"
|
|
21
|
+
"url": "https://github.com/vortiquo/node-eslint-config/issues"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -43,10 +43,12 @@
|
|
|
43
43
|
"./base-typescript": "./base-typescript.js",
|
|
44
44
|
"./react": "./react.js",
|
|
45
45
|
"./react-library": "./react-library.js",
|
|
46
|
+
"./react-library-js": "./react-library-js.js",
|
|
46
47
|
"./nextjs": "./nextjs.js",
|
|
47
48
|
"./server": "./server.js",
|
|
48
49
|
"./nestjs": "./nestjs.js",
|
|
49
|
-
"./node-library": "./node-library.js"
|
|
50
|
+
"./node-library": "./node-library.js",
|
|
51
|
+
"./node-library-js": "./node-library-js.js"
|
|
50
52
|
},
|
|
51
53
|
"files": [
|
|
52
54
|
"index.js",
|
|
@@ -54,10 +56,12 @@
|
|
|
54
56
|
"base-typescript.js",
|
|
55
57
|
"react.js",
|
|
56
58
|
"react-library.js",
|
|
59
|
+
"react-library-js.js",
|
|
57
60
|
"nextjs.js",
|
|
58
61
|
"server.js",
|
|
59
62
|
"nestjs.js",
|
|
60
63
|
"node-library.js",
|
|
64
|
+
"node-library-js.js",
|
|
61
65
|
"README.md",
|
|
62
66
|
"LICENSE"
|
|
63
67
|
],
|
|
@@ -66,17 +70,17 @@
|
|
|
66
70
|
"@commitlint/config-conventional": "^20.2.0",
|
|
67
71
|
"@eslint/js": "^9.17.0",
|
|
68
72
|
"@ls-lint/ls-lint": "^2.3.1",
|
|
69
|
-
"@next/eslint-plugin-next": "^
|
|
73
|
+
"@next/eslint-plugin-next": "^16.1.0",
|
|
70
74
|
"cz-conventional-changelog": "^3.3.0",
|
|
71
75
|
"eslint-config-prettier": "^10.0.1",
|
|
72
|
-
"eslint-import-resolver-typescript": "^
|
|
76
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
73
77
|
"eslint-plugin-import": "^2.31.0",
|
|
74
78
|
"eslint-plugin-only-warn": "^1.1.0",
|
|
75
79
|
"eslint-plugin-react": "^7.37.2",
|
|
76
|
-
"eslint-plugin-react-hooks": "^
|
|
80
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
77
81
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
78
82
|
"eslint-plugin-turbo": "^2.3.3",
|
|
79
|
-
"globals": "^
|
|
83
|
+
"globals": "^16.5.0",
|
|
80
84
|
"husky": "^9.1.7",
|
|
81
85
|
"lint-staged": "^16.2.7",
|
|
82
86
|
"prettier": "^3.7.4",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
2
|
+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import { base } from './base.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ESLint configuration for JavaScript React libraries/components.
|
|
8
|
+
* For projects without TypeScript - extends base config only.
|
|
9
|
+
*
|
|
10
|
+
* @type {import("eslint").Linter.Config[]}
|
|
11
|
+
*/
|
|
12
|
+
export const reactLibraryJs = [
|
|
13
|
+
...base,
|
|
14
|
+
{
|
|
15
|
+
name: 'vortiquo/react-library-js',
|
|
16
|
+
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
17
|
+
plugins: {
|
|
18
|
+
react: reactPlugin,
|
|
19
|
+
'react-hooks': reactHooksPlugin,
|
|
20
|
+
},
|
|
21
|
+
languageOptions: {
|
|
22
|
+
globals: {
|
|
23
|
+
...globals.browser,
|
|
24
|
+
},
|
|
25
|
+
parserOptions: {
|
|
26
|
+
ecmaFeatures: {
|
|
27
|
+
jsx: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
settings: {
|
|
32
|
+
react: {
|
|
33
|
+
version: 'detect',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
rules: {
|
|
37
|
+
// React recommended
|
|
38
|
+
...reactPlugin.configs.recommended.rules,
|
|
39
|
+
...reactPlugin.configs['jsx-runtime'].rules,
|
|
40
|
+
|
|
41
|
+
// React Hooks
|
|
42
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
43
|
+
|
|
44
|
+
// React preferences
|
|
45
|
+
'react/prop-types': 'off',
|
|
46
|
+
'react/jsx-no-target-blank': 'error',
|
|
47
|
+
'react/jsx-curly-brace-presence': [
|
|
48
|
+
'error',
|
|
49
|
+
{ props: 'never', children: 'never' },
|
|
50
|
+
],
|
|
51
|
+
'react/self-closing-comp': 'error',
|
|
52
|
+
'react/jsx-sort-props': [
|
|
53
|
+
'warn',
|
|
54
|
+
{
|
|
55
|
+
callbacksLast: true,
|
|
56
|
+
shorthandFirst: true,
|
|
57
|
+
reservedFirst: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
// Hooks
|
|
62
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
63
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
64
|
+
|
|
65
|
+
// Not needed without TypeScript
|
|
66
|
+
'react/require-default-props': 'off',
|
|
67
|
+
'react/jsx-props-no-spreading': 'off',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'vortiquo/react-library-js/config-files',
|
|
72
|
+
files: ['**/*.config.{js,mjs,cjs}', '**/.*rc.{js,mjs,cjs}'],
|
|
73
|
+
rules: {
|
|
74
|
+
'import/no-default-export': 'off',
|
|
75
|
+
'no-console': 'off',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export default reactLibraryJs;
|