@zetavg/eslint-config 0.0.8-pre.1 → 0.0.8-pre.2
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/config-sets/{default.js → base.js} +6 -1
- package/config-sets/index.js +1 -1
- package/configs/commonjs.js +3 -0
- package/configs/console-and-debugger.js +17 -0
- package/configs/{general.js → default-globals.js} +0 -5
- package/configs/imports-sort.js +6 -3
- package/configs/index.js +5 -1
- package/configs/react.js +2 -2
- package/configs/style.js +12 -0
- package/configs/typescript.js +8 -0
- package/configs/vitest.js +4 -0
- package/dist/types/config-sets/index.d.ts +1 -1
- package/dist/types/configs/default-globals.d.ts +2 -0
- package/dist/types/configs/index.d.ts +5 -1
- package/dist/types/configs/style.d.ts +2 -0
- package/dist/types/configs/typescript.d.ts +2 -0
- package/dist/types/configs/vitest.d.ts +2 -0
- package/dist/types/exports/globals.d.ts +3 -0
- package/dist/types/exports/typescript-eslint.d.ts +3 -0
- package/dist/types/exports/vitest.d.ts +2 -0
- package/exports/globals.js +4 -0
- package/exports/typescript-eslint.js +4 -0
- package/exports/vitest.js +2 -0
- package/package.json +23 -5
- package/presets/default.js +4 -5
- /package/dist/types/config-sets/{default.d.ts → base.d.ts} +0 -0
- /package/dist/types/configs/{general.d.ts → console-and-debugger.d.ts} +0 -0
|
@@ -3,15 +3,20 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import * as configs from '../configs/index.js';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Base ESLint configuration that should apply to all JavaScript and TypeScript
|
|
8
|
+
* files.
|
|
9
|
+
*/
|
|
6
10
|
export default defineConfig([
|
|
7
11
|
{
|
|
8
12
|
extends: [
|
|
9
13
|
js.configs.recommended,
|
|
10
14
|
configs.prettier,
|
|
11
|
-
configs.
|
|
15
|
+
configs.style,
|
|
12
16
|
configs.noUnusedVars,
|
|
13
17
|
configs.imports,
|
|
14
18
|
configs.importsSort,
|
|
19
|
+
configs.consoleAndDebugger,
|
|
15
20
|
configs.todoComments,
|
|
16
21
|
],
|
|
17
22
|
},
|
package/config-sets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as base } from './base.js';
|
package/configs/commonjs.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Warns on `console.log` and `debugger` statements to prevent them from
|
|
5
|
+
* slipping into production code.
|
|
6
|
+
*
|
|
7
|
+
* Use `console.info`, `console.warn`, or `console.error` for intentional logging;
|
|
8
|
+
* reserve `console.log` for temporary debugging only.
|
|
9
|
+
*/
|
|
10
|
+
export default defineConfig([
|
|
11
|
+
{
|
|
12
|
+
rules: {
|
|
13
|
+
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
|
|
14
|
+
'no-debugger': 'warn',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
]);
|
|
@@ -3,11 +3,6 @@ import globals from 'globals';
|
|
|
3
3
|
|
|
4
4
|
export default defineConfig([
|
|
5
5
|
{
|
|
6
|
-
rules: {
|
|
7
|
-
curly: ['warn', 'multi-line', 'consistent'],
|
|
8
|
-
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
|
|
9
|
-
'no-debugger': 'warn',
|
|
10
|
-
},
|
|
11
6
|
languageOptions: {
|
|
12
7
|
globals: {
|
|
13
8
|
...globals['shared-node-browser'],
|
package/configs/imports-sort.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
2
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Enforces a consistent import ordering convention using automatic sorting,
|
|
6
|
+
* eliminating the need to debate or manually maintain import order.
|
|
7
|
+
* Violations are reported as warnings and can be auto-fixed.
|
|
8
|
+
*/
|
|
4
9
|
export default defineConfig([
|
|
5
10
|
{
|
|
6
11
|
plugins: {
|
|
@@ -22,9 +27,7 @@ export default defineConfig([
|
|
|
22
27
|
// Packages. `react` related packages come first.
|
|
23
28
|
['^react$', '^react/', '^react-dom', '^react', '^@?\\w'],
|
|
24
29
|
// Internal packages.
|
|
25
|
-
[
|
|
26
|
-
'^(@|@zetavg|components|utils|config|vendored-lib)(/.*|$)',
|
|
27
|
-
],
|
|
30
|
+
['^(@|@zetavg|components|utils|config|vendored-lib)(/.*|$)'],
|
|
28
31
|
// Side effect imports.
|
|
29
32
|
['^\\u0000'],
|
|
30
33
|
// Parent imports. Put `..` last.
|
package/configs/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as commonjs } from './commonjs.js';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as consoleAndDebugger } from './console-and-debugger.js';
|
|
3
|
+
export { default as defaultGlobals } from './default-globals.js';
|
|
3
4
|
export { default as imports } from './imports.js';
|
|
4
5
|
export { default as importsSort } from './imports-sort.js';
|
|
5
6
|
export { default as json } from './json.js';
|
|
@@ -7,4 +8,7 @@ export { default as markdown } from './markdown.js';
|
|
|
7
8
|
export { default as noUnusedVars } from './no-unused.js';
|
|
8
9
|
export { default as prettier } from './prettier.js';
|
|
9
10
|
export { default as react } from './react.js';
|
|
11
|
+
export { default as style } from './style.js';
|
|
10
12
|
export { default as todoComments } from './todo-comments.js';
|
|
13
|
+
export { default as typescript } from './typescript.js';
|
|
14
|
+
export { default as vitest } from './vitest.js';
|
package/configs/react.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
2
|
import react from 'eslint-plugin-react';
|
|
3
3
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import
|
|
4
|
+
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
|
|
5
5
|
import globals from 'globals';
|
|
6
6
|
|
|
7
7
|
export default defineConfig([
|
|
8
8
|
react.configs.flat.recommended,
|
|
9
9
|
reactHooks.configs['recommended-latest'],
|
|
10
|
-
|
|
10
|
+
reactRefreshPlugin.configs.recommended,
|
|
11
11
|
{
|
|
12
12
|
languageOptions: {
|
|
13
13
|
globals: globals.browser,
|
package/configs/style.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./
|
|
1
|
+
export { default as base } from "./base.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as commonjs } from "./commonjs.js";
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as consoleAndDebugger } from "./console-and-debugger.js";
|
|
3
|
+
export { default as defaultGlobals } from "./default-globals.js";
|
|
3
4
|
export { default as imports } from "./imports.js";
|
|
4
5
|
export { default as importsSort } from "./imports-sort.js";
|
|
5
6
|
export { default as json } from "./json.js";
|
|
@@ -7,4 +8,7 @@ export { default as markdown } from "./markdown.js";
|
|
|
7
8
|
export { default as noUnusedVars } from "./no-unused.js";
|
|
8
9
|
export { default as prettier } from "./prettier.js";
|
|
9
10
|
export { default as react } from "./react.js";
|
|
11
|
+
export { default as style } from "./style.js";
|
|
10
12
|
export { default as todoComments } from "./todo-comments.js";
|
|
13
|
+
export { default as typescript } from "./typescript.js";
|
|
14
|
+
export { default as vitest } from "./vitest.js";
|
package/package.json
CHANGED
|
@@ -2,7 +2,25 @@
|
|
|
2
2
|
"name": "@zetavg/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"main": "index.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"types": "dist/types/index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"default": "./index.js",
|
|
9
|
+
"types": "./dist/types/index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./globals": {
|
|
12
|
+
"default": "./exports/globals.js",
|
|
13
|
+
"types": "./dist/types/exports/globals.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./typescript-eslint": {
|
|
16
|
+
"default": "./exports/typescript-eslint.js",
|
|
17
|
+
"types": "./dist/types/exports/typescript-eslint.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./vitest": {
|
|
20
|
+
"default": "./exports/vitest.js",
|
|
21
|
+
"types": "./dist/types/exports/vitest.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
6
24
|
"repository": {
|
|
7
25
|
"type": "git",
|
|
8
26
|
"url": "https://github.com/zetavg/es-configs",
|
|
@@ -21,7 +39,7 @@
|
|
|
21
39
|
"peerDependencies": {
|
|
22
40
|
"eslint": "^9 || ^10",
|
|
23
41
|
"prettier": "^3",
|
|
24
|
-
"typescript": ">=5
|
|
42
|
+
"typescript": ">=5"
|
|
25
43
|
},
|
|
26
44
|
"peerDependenciesMeta": {
|
|
27
45
|
"typescript": {
|
|
@@ -46,11 +64,11 @@
|
|
|
46
64
|
"typescript-eslint": "^8"
|
|
47
65
|
},
|
|
48
66
|
"devDependencies": {
|
|
49
|
-
"@zetavg/prettier-config": "^0.0.8-pre.
|
|
50
|
-
"@zetavg/tsconfig": "^0.0.8-pre.
|
|
67
|
+
"@zetavg/prettier-config": "^0.0.8-pre.2",
|
|
68
|
+
"@zetavg/tsconfig": "^0.0.8-pre.2",
|
|
51
69
|
"eslint": "^9",
|
|
52
70
|
"prettier": "^3",
|
|
53
71
|
"typescript": "~5.8"
|
|
54
72
|
},
|
|
55
|
-
"version": "0.0.8-pre.
|
|
73
|
+
"version": "0.0.8-pre.2"
|
|
56
74
|
}
|
package/presets/default.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import vitest from '@vitest/eslint-plugin';
|
|
2
1
|
import { defineConfig } from 'eslint/config';
|
|
3
|
-
import tseslint from 'typescript-eslint';
|
|
4
2
|
|
|
5
3
|
import * as configSets from '../config-sets/index.js';
|
|
6
4
|
import * as configs from '../configs/index.js';
|
|
7
5
|
|
|
8
6
|
export default defineConfig([
|
|
9
7
|
{ ignores: ['dist', 'node_modules'] },
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
configs.typescript,
|
|
9
|
+
configs.vitest,
|
|
12
10
|
configs.json,
|
|
13
11
|
configs.markdown,
|
|
12
|
+
configs.defaultGlobals,
|
|
14
13
|
{
|
|
15
14
|
name: 'Configs Applied to All JS/TS Files',
|
|
16
15
|
files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
|
|
17
|
-
extends: [configSets.
|
|
16
|
+
extends: [configSets.base],
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
19
|
name: 'Configs for React Files',
|
|
File without changes
|
|
File without changes
|