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