@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.
@@ -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.general,
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
  },
@@ -1 +1 @@
1
- export { default as default } from './default.js';
1
+ export { default as base } from './base.js';
@@ -1,6 +1,9 @@
1
1
  import { defineConfig } from 'eslint/config';
2
2
  import globals from 'globals';
3
3
 
4
+ /**
5
+ * CommonJS-specific ESLint configuration. Should only apply to CommonJS files.
6
+ */
4
7
  export default defineConfig([
5
8
  {
6
9
  languageOptions: {
@@ -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'],
@@ -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 general } from './general.js';
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 reactRefresh from 'eslint-plugin-react-refresh';
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
- reactRefresh.configs.recommended,
10
+ reactRefreshPlugin.configs.recommended,
11
11
  {
12
12
  languageOptions: {
13
13
  globals: globals.browser,
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from 'eslint/config';
2
+
3
+ /**
4
+ * Enforces consistent code style and formatting rules to improve readability.
5
+ */
6
+ export default defineConfig([
7
+ {
8
+ rules: {
9
+ curly: ['warn', 'multi-line', 'consistent'],
10
+ },
11
+ },
12
+ ]);
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'eslint/config';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ /**
5
+ * Default ESLint configuration for TypeScript.
6
+ * Should already be scoped to TypeScript files.
7
+ */
8
+ export default defineConfig([tseslint.configs.recommended]);
@@ -0,0 +1,4 @@
1
+ import vitest from '@vitest/eslint-plugin';
2
+ import { defineConfig } from 'eslint/config';
3
+
4
+ export default defineConfig([vitest.configs.recommended]);
@@ -1 +1 @@
1
- export { default } from "./default.js";
1
+ export { default as base } from "./base.js";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  export { default as commonjs } from "./commonjs.js";
2
- export { default as general } from "./general.js";
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";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default globals;
2
+ export * from "globals";
3
+ import globals from 'globals';
@@ -0,0 +1,3 @@
1
+ export default tsEslint;
2
+ export * from "typescript-eslint";
3
+ import tsEslint from 'typescript-eslint';
@@ -0,0 +1,2 @@
1
+ export default vitest;
2
+ import vitest from '@vitest/eslint-plugin';
@@ -0,0 +1,4 @@
1
+ import globals from 'globals';
2
+ export default globals;
3
+
4
+ export * from 'globals';
@@ -0,0 +1,4 @@
1
+ import tsEslint from 'typescript-eslint';
2
+ export default tsEslint;
3
+
4
+ export * from 'typescript-eslint';
@@ -0,0 +1,2 @@
1
+ import vitest from '@vitest/eslint-plugin';
2
+ export default vitest;
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.8"
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.1",
50
- "@zetavg/tsconfig": "^0.0.8-pre.1",
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.1"
73
+ "version": "0.0.8-pre.2"
56
74
  }
@@ -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
- tseslint.configs.recommended,
11
- vitest.configs.recommended,
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.default],
16
+ extends: [configSets.base],
18
17
  },
19
18
  {
20
19
  name: 'Configs for React Files',