@nijesmik/eslint-config 0.3.0 → 0.4.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.
@@ -0,0 +1,133 @@
1
+ // index.ts
2
+ import json from "@eslint/json";
3
+ import importPlugin from "eslint-plugin-import";
4
+ import perfectionist from "eslint-plugin-perfectionist";
5
+ import { Alphabet } from "eslint-plugin-perfectionist/alphabet";
6
+ import react from "eslint-plugin-react";
7
+ import reactHooks from "eslint-plugin-react-hooks";
8
+ import unusedImports from "eslint-plugin-unused-imports";
9
+ import { defineConfig } from "eslint/config";
10
+ import tseslint from "typescript-eslint";
11
+ var sortOptions = {
12
+ type: "unsorted",
13
+ groups: ["unknown", "method", "callback"],
14
+ customGroups: [
15
+ {
16
+ type: "unsorted",
17
+ groupName: "callback",
18
+ elementNamePattern: "^on[A-Z]"
19
+ }
20
+ ]
21
+ };
22
+ var index_default = defineConfig([
23
+ {
24
+ ignores: ["**/*.gen.ts", "**/dist/**"]
25
+ },
26
+ ...tseslint.configs.recommended,
27
+ {
28
+ files: ["**/*.{ts,mts,cts,tsx}"],
29
+ languageOptions: {
30
+ parserOptions: {
31
+ tsconfigRootDir: process.cwd()
32
+ }
33
+ },
34
+ rules: {
35
+ "@typescript-eslint/no-unused-vars": [
36
+ "error",
37
+ {
38
+ argsIgnorePattern: "^_",
39
+ varsIgnorePattern: "^_",
40
+ caughtErrorsIgnorePattern: "^_"
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ {
46
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
47
+ plugins: { perfectionist, import: importPlugin, "unused-imports": unusedImports, react },
48
+ rules: {
49
+ "eol-last": ["error", "always"],
50
+ "no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1, maxBOF: 0 }],
51
+ "unused-imports/no-unused-imports": "error",
52
+ "react/jsx-curly-brace-presence": ["error", { props: "never", children: "never" }]
53
+ }
54
+ },
55
+ {
56
+ ...reactHooks.configs.flat["recommended-latest"],
57
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"]
58
+ },
59
+ {
60
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
61
+ rules: {
62
+ "react-hooks/exhaustive-deps": "off"
63
+ }
64
+ },
65
+ {
66
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
67
+ ignores: ["**/*.config.{js,mjs,cjs,ts,mts,cts}"],
68
+ rules: {
69
+ ...perfectionist.configs["recommended-alphabetical"].rules,
70
+ "perfectionist/sort-switch-case": "off",
71
+ "perfectionist/sort-classes": "off",
72
+ "perfectionist/sort-interfaces": ["error", sortOptions],
73
+ "perfectionist/sort-modules": "off",
74
+ "perfectionist/sort-jsx-props": "off",
75
+ "perfectionist/sort-exports": [
76
+ "error",
77
+ {
78
+ partitionByNewLine: true,
79
+ groups: ["unknown", "type-export"]
80
+ }
81
+ ],
82
+ "perfectionist/sort-objects": "off",
83
+ "perfectionist/sort-union-types": [
84
+ "error",
85
+ {
86
+ type: "unsorted",
87
+ groups: ["unknown", "nullish"]
88
+ }
89
+ ],
90
+ "perfectionist/sort-object-types": ["error", sortOptions],
91
+ "perfectionist/sort-intersection-types": [
92
+ "error",
93
+ {
94
+ type: "unsorted",
95
+ groups: ["named", "unknown"]
96
+ }
97
+ ],
98
+ "import/no-duplicates": ["error", { "prefer-inline": false }],
99
+ curly: ["error", "all"]
100
+ }
101
+ },
102
+ {
103
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
104
+ rules: {
105
+ "perfectionist/sort-named-imports": [
106
+ "error",
107
+ {
108
+ type: "custom",
109
+ alphabet: Alphabet.generateRecommendedAlphabet().sortByLocaleCompare("en-US").placeAllWithCaseBeforeAllWithOtherCase("lowercase").getCharacters(),
110
+ ignoreCase: false,
111
+ groups: ["value-import", { newlinesBetween: 0 }, "type-import"]
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ files: ["**/*.json"],
118
+ ignores: ["**/tsconfig.json", "**/tsconfig.*.json"],
119
+ plugins: { json },
120
+ language: "json/json",
121
+ extends: ["json/recommended"]
122
+ },
123
+ {
124
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
125
+ plugins: { json },
126
+ language: "json/jsonc",
127
+ extends: ["json/recommended"]
128
+ }
129
+ ]);
130
+
131
+ export {
132
+ index_default
133
+ };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-SZKMGGXH.js";
3
+ } from "./chunk-45WJWPGC.js";
4
4
  export {
5
5
  index_default as default
6
6
  };
package/dist/next.js CHANGED
@@ -1,22 +1,26 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-SZKMGGXH.js";
3
+ } from "./chunk-45WJWPGC.js";
4
4
 
5
5
  // next.ts
6
6
  import nextPlugin from "@next/eslint-plugin-next";
7
7
  import jsxA11y from "eslint-plugin-jsx-a11y";
8
- import reactHooks from "eslint-plugin-react-hooks";
9
8
  import { defineConfig } from "eslint/config";
10
9
  var next_default = defineConfig([
11
10
  ...index_default,
12
11
  // Following eslint-config-next/typescript
13
12
  { ignores: [".next/**", "out/**", "build/**", "next-env.d.ts"] },
14
- nextPlugin.configs["core-web-vitals"],
15
- reactHooks.configs.flat["recommended-latest"],
16
- jsxA11y.flatConfigs.recommended,
17
13
  {
14
+ ...nextPlugin.configs["core-web-vitals"],
15
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"]
16
+ },
17
+ {
18
+ ...jsxA11y.flatConfigs.recommended,
19
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"]
20
+ },
21
+ {
22
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
18
23
  rules: {
19
- "react-hooks/exhaustive-deps": "off",
20
24
  "jsx-a11y/alt-text": ["warn", { elements: ["img"], img: ["Image"] }]
21
25
  },
22
26
  settings: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nijesmik/eslint-config",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,6 +24,7 @@
24
24
  "eslint-plugin-import": "^2.32.0",
25
25
  "eslint-plugin-jsx-a11y": "^6.10.2",
26
26
  "eslint-plugin-perfectionist": "^5.4.0",
27
+ "eslint-plugin-react": "^7.37.5",
27
28
  "eslint-plugin-react-hooks": "^7.1.1",
28
29
  "eslint-plugin-unused-imports": "^4.4.1",
29
30
  "typescript-eslint": "^8.46.4"