@kasoa/eslint-config 0.0.9 → 0.0.11

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 CHANGED
@@ -18,51 +18,37 @@ Import the desired config in your `eslint.config.ts` (using ESLint's flat config
18
18
 
19
19
  ### React Projects
20
20
 
21
- For React applications with TypeScript:
21
+ ```js
22
+ export { react as default } from "@kasoa/eslint-config/react";
23
+ ```
24
+
25
+ ### Node.js Projects
22
26
 
23
27
  ```js
24
- import { react } from "@kasoa/eslint-config/react";
25
- import { defineConfig } from "eslint/config";
28
+ export { node as default } from "@kasoa/eslint-config/node";
29
+ ```
26
30
 
27
- export default defineConfig(react, {
28
- languageOptions: {
29
- parserOptions: {
30
- tsconfigRootDir: import.meta.dirname,
31
- projectService: true,
32
- },
33
- },
34
- });
31
+ ### Base Config
32
+
33
+ ```js
34
+ export { base as default } from "@kasoa/eslint-config/base";
35
35
  ```
36
36
 
37
- ### Node.js Projects
37
+ ### Custom Overrides
38
38
 
39
- For Node.js backends or scripts:
39
+ Use `defineConfig` to add project-specific rules:
40
40
 
41
41
  ```js
42
42
  import { node } from "@kasoa/eslint-config/node";
43
43
  import { defineConfig } from "eslint/config";
44
44
 
45
45
  export default defineConfig(node, {
46
- // Add custom rules or overrides here
47
46
  rules: {
48
47
  "no-console": "warn",
49
48
  },
50
49
  });
51
50
  ```
52
51
 
53
- ### Base Config
54
-
55
- For minimal setups (e.g., libraries or custom extensions):
56
-
57
- ```js
58
- import { base } from "@kasoa/eslint-config/base";
59
- import { defineConfig } from "eslint/config";
60
-
61
- export default defineConfig(base, {
62
- // Customize as needed
63
- });
64
- ```
65
-
66
52
  ## Configurations
67
53
 
68
54
  - **`base`**: Core rules for TypeScript, imports, code quality, and testing.
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,kCAmBjC,CAAC"}
1
+ {"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,kCAejC,CAAC"}
@@ -1,20 +1,16 @@
1
1
  import { defineConfig } from "eslint/config";
2
2
  import typescriptEslint from "typescript-eslint";
3
3
  export const typescriptEslintConfig = defineConfig({
4
- files: [
5
- "**/*.js",
6
- "**/*.jsx",
7
- "**/*.mjs",
8
- "**/*.cjs",
9
- "**/*.ts",
10
- "**/*.tsx",
11
- "**/*.mts",
12
- "**/*.cts",
13
- ],
4
+ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
14
5
  extends: [
15
6
  typescriptEslint.configs.strictTypeChecked,
16
7
  typescriptEslint.configs.stylisticTypeChecked,
17
8
  ],
9
+ languageOptions: {
10
+ parserOptions: {
11
+ projectService: true,
12
+ },
13
+ },
18
14
  rules: {
19
15
  "@typescript-eslint/no-unused-vars": "off",
20
16
  "@typescript-eslint/consistent-type-imports": "error",
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-react.d.ts","sourceRoot":"","sources":["../../src/react/eslint-react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,kCAQ7B,CAAC"}
1
+ {"version":3,"file":"eslint-react.d.ts","sourceRoot":"","sources":["../../src/react/eslint-react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,kCAO5B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import eslintReact from "@eslint-react/eslint-plugin";
2
2
  import { defineConfig } from "eslint/config";
3
- export const eslintReactConfig = defineConfig(eslintReact.configs["strict-type-checked"], {
3
+ export const eslintReactConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [eslintReact.configs["strict-type-checked"]],
4
6
  rules: {
5
7
  "@eslint-react/prefer-namespace-import": "error",
6
8
  "@eslint-react/no-unstable-context-value": "off",
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-a11y.d.ts","sourceRoot":"","sources":["../../src/react/jsx-a11y.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kCAA2C,CAAC"}
1
+ {"version":3,"file":"jsx-a11y.d.ts","sourceRoot":"","sources":["../../src/react/jsx-a11y.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kCAGxB,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import jsxA11y from "eslint-plugin-jsx-a11y";
2
2
  import { defineConfig } from "eslint/config";
3
- export const jsxA11yConfig = defineConfig(jsxA11y.flatConfigs.strict);
3
+ export const jsxA11yConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [jsxA11y.flatConfigs.strict],
6
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../src/react/react-compiler.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,kCAE/B,CAAC"}
1
+ {"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../src/react/react-compiler.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,kCAG9B,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import reactCompiler from "eslint-plugin-react-compiler";
2
2
  import { defineConfig } from "eslint/config";
3
- export const reactCompilerConfig = defineConfig(reactCompiler.configs.recommended);
3
+ export const reactCompilerConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [reactCompiler.configs.recommended],
6
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/react/react-hooks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,kCAE5B,CAAC"}
1
+ {"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/react/react-hooks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,kCAG3B,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import reactHooks from "eslint-plugin-react-hooks";
2
2
  import { defineConfig } from "eslint/config";
3
- export const reactHooksConfig = defineConfig(reactHooks.configs.flat["recommended-latest"]);
3
+ export const reactHooksConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [reactHooks.configs.flat["recommended-latest"]],
6
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"react-refresh.d.ts","sourceRoot":"","sources":["../../src/react/react-refresh.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,kCAE9B,CAAC"}
1
+ {"version":3,"file":"react-refresh.d.ts","sourceRoot":"","sources":["../../src/react/react-refresh.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,kCAG7B,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import reactRefresh from "eslint-plugin-react-refresh";
2
2
  import { defineConfig } from "eslint/config";
3
- export const reactRefreshConfig = defineConfig(reactRefresh.configs.recommended);
3
+ export const reactRefreshConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [reactRefresh.configs.recommended],
6
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"react-you-might-not-need-an-effect.d.ts","sourceRoot":"","sources":["../../src/react/react-you-might-not-need-an-effect.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kCAAkC,kCAE9C,CAAC"}
1
+ {"version":3,"file":"react-you-might-not-need-an-effect.d.ts","sourceRoot":"","sources":["../../src/react/react-you-might-not-need-an-effect.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kCAAkC,kCAG7C,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
2
2
  import { defineConfig } from "eslint/config";
3
- export const reactYouMightNotNeedAnEffectConfig = defineConfig(reactYouMightNotNeedAnEffect.configs.recommended);
3
+ export const reactYouMightNotNeedAnEffectConfig = defineConfig({
4
+ files: ["**/*.{js,jsx,ts,tsx}"],
5
+ extends: [reactYouMightNotNeedAnEffect.configs.recommended],
6
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasoa/eslint-config",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Kasoa's ESLint config",
@@ -2,20 +2,16 @@ import { defineConfig } from "eslint/config";
2
2
  import typescriptEslint from "typescript-eslint";
3
3
 
4
4
  export const typescriptEslintConfig = defineConfig({
5
- files: [
6
- "**/*.js",
7
- "**/*.jsx",
8
- "**/*.mjs",
9
- "**/*.cjs",
10
- "**/*.ts",
11
- "**/*.tsx",
12
- "**/*.mts",
13
- "**/*.cts",
14
- ],
5
+ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
15
6
  extends: [
16
7
  typescriptEslint.configs.strictTypeChecked,
17
8
  typescriptEslint.configs.stylisticTypeChecked,
18
9
  ],
10
+ languageOptions: {
11
+ parserOptions: {
12
+ projectService: true,
13
+ },
14
+ },
19
15
  rules: {
20
16
  "@typescript-eslint/no-unused-vars": "off",
21
17
  "@typescript-eslint/consistent-type-imports": "error",
@@ -1,12 +1,11 @@
1
1
  import eslintReact from "@eslint-react/eslint-plugin";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const eslintReactConfig = defineConfig(
5
- eslintReact.configs["strict-type-checked"],
6
- {
7
- rules: {
8
- "@eslint-react/prefer-namespace-import": "error",
9
- "@eslint-react/no-unstable-context-value": "off",
10
- },
4
+ export const eslintReactConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [eslintReact.configs["strict-type-checked"]],
7
+ rules: {
8
+ "@eslint-react/prefer-namespace-import": "error",
9
+ "@eslint-react/no-unstable-context-value": "off",
11
10
  },
12
- );
11
+ });
@@ -1,4 +1,7 @@
1
1
  import jsxA11y from "eslint-plugin-jsx-a11y";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const jsxA11yConfig = defineConfig(jsxA11y.flatConfigs.strict);
4
+ export const jsxA11yConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [jsxA11y.flatConfigs.strict],
7
+ });
@@ -1,6 +1,7 @@
1
1
  import reactCompiler from "eslint-plugin-react-compiler";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const reactCompilerConfig = defineConfig(
5
- reactCompiler.configs.recommended,
6
- );
4
+ export const reactCompilerConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [reactCompiler.configs.recommended],
7
+ });
@@ -1,6 +1,7 @@
1
1
  import reactHooks from "eslint-plugin-react-hooks";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const reactHooksConfig = defineConfig(
5
- reactHooks.configs.flat["recommended-latest"],
6
- );
4
+ export const reactHooksConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [reactHooks.configs.flat["recommended-latest"]],
7
+ });
@@ -1,6 +1,7 @@
1
1
  import reactRefresh from "eslint-plugin-react-refresh";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const reactRefreshConfig = defineConfig(
5
- reactRefresh.configs.recommended,
6
- );
4
+ export const reactRefreshConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [reactRefresh.configs.recommended],
7
+ });
@@ -1,6 +1,7 @@
1
1
  import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- export const reactYouMightNotNeedAnEffectConfig = defineConfig(
5
- reactYouMightNotNeedAnEffect.configs.recommended,
6
- );
4
+ export const reactYouMightNotNeedAnEffectConfig = defineConfig({
5
+ files: ["**/*.{js,jsx,ts,tsx}"],
6
+ extends: [reactYouMightNotNeedAnEffect.configs.recommended],
7
+ });