@omer-x/eslint-config 1.0.6 → 2.0.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.
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @omer-x/eslint-config
2
2
 
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ [![npm version](https://img.shields.io/npm/v/@omer-x/eslint-config?logo=npm&logoColor=CB3837&color=CB3837)](https://www.npmjs.com/package/@omer-x/eslint-config)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@omer-x/eslint-config?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTI4OCAzMmMwLTE3LjctMTQuMy0zMi0zMi0zMnMtMzIgMTQuMy0zMiAzMmwwIDI0Mi43LTczLjQtNzMuNGMtMTIuNS0xMi41LTMyLjgtMTIuNS00NS4zIDBzLTEyLjUgMzIuOCAwIDQ1LjNsMTI4IDEyOGMxMi41IDEyLjUgMzIuOCAxMi41IDQ1LjMgMGwxMjgtMTI4YzEyLjUtMTIuNSAxMi41LTMyLjggMC00NS4zcy0zMi44LTEyLjUtNDUuMyAwTDI4OCAyNzQuNyAyODggMzJ6TTY0IDM1MmMtMzUuMyAwLTY0IDI4LjctNjQgNjRsMCAzMmMwIDM1LjMgMjguNyA2NCA2NCA2NGwzODQgMGMzNS4zIDAgNjQtMjguNyA2NC02NGwwLTMyYzAtMzUuMy0yOC43LTY0LTY0LTY0bC0xMDEuNSAwLTQ1LjMgNDUuM2MtMjUgMjUtNjUuNSAyNS05MC41IDBMMTY1LjUgMzUyIDY0IDM1MnptMzY4IDU2YTI0IDI0IDAgMSAxIDAgNDggMjQgMjQgMCAxIDEgMC00OHoiIGZpbGw9IiMwMDc4MjAiIC8+PC9zdmc+&color=007820)](https://www.npmjs.com/package/@omer-x/eslint-config)
5
+ [![codecov](https://codecov.io/gh/omermecitoglu/eslint-config/branch/main/graph/badge.svg)](https://codecov.io/gh/omermecitoglu/eslint-config)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTM4NCAzMmwxMjggMGMxNy43IDAgMzIgMTQuMyAzMiAzMnMtMTQuMyAzMi0zMiAzMkwzOTguNCA5NmMtNS4yIDI1LjgtMjIuOSA0Ny4xLTQ2LjQgNTcuM0wzNTIgNDQ4bDE2MCAwYzE3LjcgMCAzMiAxNC4zIDMyIDMycy0xNC4zIDMyLTMyIDMybC0xOTIgMC0xOTIgMGMtMTcuNyAwLTMyLTE0LjMtMzItMzJzMTQuMy0zMiAzMi0zMmwxNjAgMCAwLTI5NC43Yy0yMy41LTEwLjMtNDEuMi0zMS42LTQ2LjQtNTcuM0wxMjggOTZjLTE3LjcgMC0zMi0xNC4zLTMyLTMyczE0LjMtMzIgMzItMzJsMTI4IDBjMTQuNi0xOS40IDM3LjgtMzIgNjQtMzJzNDkuNCAxMi42IDY0IDMyem01NS42IDI4OGwxNDQuOSAwTDUxMiAxOTUuOCA0MzkuNiAzMjB6TTUxMiA0MTZjLTYyLjkgMC0xMTUuMi0zNC0xMjYtNzguOWMtMi42LTExIDEtMjIuMyA2LjctMzIuMWw5NS4yLTE2My4yYzUtOC42IDE0LjItMTMuOCAyNC4xLTEzLjhzMTkuMSA1LjMgMjQuMSAxMy44bDk1LjIgMTYzLjJjNS43IDkuOCA5LjMgMjEuMSA2LjcgMzIuMUM2MjcuMiAzODIgNTc0LjkgNDE2IDUxMiA0MTZ6TTEyNi44IDE5NS44TDU0LjQgMzIwbDE0NC45IDBMMTI2LjggMTk1Ljh6TS45IDMzNy4xYy0yLjYtMTEgMS0yMi4zIDYuNy0zMi4xbDk1LjItMTYzLjJjNS04LjYgMTQuMi0xMy44IDI0LjEtMTMuOHMxOS4xIDUuMyAyNC4xIDEzLjhsOTUuMiAxNjMuMmM1LjcgOS44IDkuMyAyMS4xIDYuNyAzMi4xQzI0MiAzODIgMTg5LjcgNDE2IDEyNi44IDQxNlMxMS43IDM4MiAuOSAzMzcuMXoiIGZpbGw9IiNEMEE4MUMiIC8+PC9zdmc+)](https://opensource.org/licenses/MIT)
7
+ [![GitHub last commit](https://img.shields.io/github/last-commit/omermecitoglu/eslint-config?color=c977be&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTMyMCAzMzZhODAgODAgMCAxIDAgMC0xNjAgODAgODAgMCAxIDAgMCAxNjB6bTE1Ni44LTQ4QzQ2MiAzNjEgMzk3LjQgNDE2IDMyMCA0MTZzLTE0Mi01NS0xNTYuOC0xMjhMMzIgMjg4Yy0xNy43IDAtMzItMTQuMy0zMi0zMnMxNC4zLTMyIDMyLTMybDEzMS4yIDBDMTc4IDE1MSAyNDIuNiA5NiAzMjAgOTZzMTQyIDU1IDE1Ni44IDEyOEw2MDggMjI0YzE3LjcgMCAzMiAxNC4zIDMyIDMycy0xNC4zIDMyLTMyIDMybC0xMzEuMiAweiIgZmlsbD0iI0M5NzdCRSIgLz48L3N2Zz4=)](https://github.com/omermecitoglu/eslint-config/commits/main/)
8
+ [![GitHub issues](https://img.shields.io/github/issues/omermecitoglu/eslint-config?color=a38eed&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBkPSJNOCA5LjVhMS41IDEuNSAwIDEgMCAwLTMgMS41IDEuNSAwIDAgMCAwIDNaIiBmaWxsPSIjQTM4RUVEIj48L3BhdGg+CiAgPHBhdGggZD0iTTggMGE4IDggMCAxIDEgMCAxNkE4IDggMCAwIDEgOCAwWk0xLjUgOGE2LjUgNi41IDAgMSAwIDEzIDAgNi41IDYuNSAwIDAgMC0xMyAwWiIgZmlsbD0iI0EzOEVFRCI+PC9wYXRoPgo8L3N2Zz4=)](https://github.com/omermecitoglu/eslint-config/issues)
9
+ [![GitHub stars](https://img.shields.io/github/stars/omermecitoglu/eslint-config?style=social)](https://github.com/omermecitoglu/eslint-config)
4
10
 
5
11
  This package contains my favorite ESLint rules, created following [this tutorial](https://eslint.org/docs/latest/extend/shareable-configs) on ESLint's shareable configs.
6
12
 
@@ -14,20 +20,50 @@ npm install @omer-x/eslint-config --save-dev
14
20
 
15
21
  Ensure you have the following peer dependencies installed:
16
22
 
17
- - `eslint >= 8`
23
+ - `eslint >= 9`
18
24
 
19
25
  ## Usage
20
26
 
21
- Add the configuration to your ESLint configuration file (e.g., `.eslintrc.js`):
27
+ Add the configuration to your ESLint configuration file (e.g., `eslint.config.js` or `eslint.config.mjs`):
22
28
 
23
29
  ```javascript
24
- module.exports = {
25
- extends: [
26
- "@omer-x/eslint-config",
27
- "@omer-x/eslint-config/typescript" // optional
28
- ],
29
- // other configurations...
30
- };
30
+ import omer from "@omer-x/eslint-config";
31
+
32
+ export default [
33
+ ...omer,
34
+ {
35
+ rules: {
36
+ // add your other rules here
37
+ },
38
+ },
39
+ ];
40
+ ```
41
+
42
+ Or you can install components individually
43
+
44
+ ```javascript
45
+ import base from "@omer-x/eslint-config/base";
46
+ import stylistic from "@omer-x/eslint-config/stylistic";
47
+ import typescript from "@omer-x/eslint-config/typescript";
48
+ import react from "@omer-x/eslint-config/react";
49
+ import jsxAccessibility from "@omer-x/eslint-config/jsx-a11y";
50
+ import importPlugin from "@omer-x/eslint-config/import";
51
+ import unusedImports from "@omer-x/eslint-config/unused-imports";
52
+
53
+ export default [
54
+ ...base,
55
+ ...stylistic,
56
+ ...typescript,
57
+ ...react,
58
+ ...jsxAccessibility,
59
+ ...importPlugin,
60
+ ...unusedImports,
61
+ {
62
+ rules: {
63
+ // add your other rules here
64
+ },
65
+ },
66
+ ];
31
67
  ```
32
68
 
33
69
  ## License
package/dist/base.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
package/dist/base.js ADDED
@@ -0,0 +1,27 @@
1
+ import eslint from "@eslint/js";
2
+ export default [
3
+ eslint.configs.recommended,
4
+ {
5
+ rules: {
6
+ "array-callback-return": "error",
7
+ "class-methods-use-this": "error",
8
+ "curly": ["error", "multi-line", "consistent"],
9
+ "dot-notation": "error",
10
+ "eqeqeq": "error",
11
+ "line-comment-position": "off",
12
+ "max-nested-callbacks": ["error", { max: 4 }],
13
+ "max-statements-per-line": ["error", { max: 2 }],
14
+ "no-console": "warn",
15
+ "no-duplicate-imports": "error",
16
+ "no-empty-function": "error",
17
+ "no-lonely-if": "error",
18
+ "no-shadow": ["error", { allow: ["err", "resolve", "reject"] }],
19
+ "no-var": "error",
20
+ "prefer-const": "error",
21
+ "require-await": "warn",
22
+ "sort-imports": ["error", { ignoreDeclarationSort: true }],
23
+ "unicode-bom": ["error", "never"],
24
+ "yoda": "error",
25
+ },
26
+ },
27
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
package/dist/import.js ADDED
@@ -0,0 +1,20 @@
1
+ import importPlugin from "eslint-plugin-import";
2
+ export default [
3
+ {
4
+ plugins: {
5
+ import: importPlugin,
6
+ },
7
+ rules: {
8
+ "import/order": ["error", {
9
+ alphabetize: {
10
+ caseInsensitive: false,
11
+ order: "asc",
12
+ },
13
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type", "object"],
14
+ pathGroups: [
15
+ { group: "internal", pattern: "~/**" },
16
+ ],
17
+ }],
18
+ },
19
+ },
20
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ import base from "./base";
2
+ import importPlugin from "./import";
3
+ import jsxAccessibility from "./jsx-a11y";
4
+ import react from "./react";
5
+ import stylistic from "./stylistic";
6
+ import typescript from "./typescript";
7
+ import unusedImports from "./unused-imports";
8
+ export default [
9
+ ...base,
10
+ ...stylistic,
11
+ ...typescript,
12
+ ...react,
13
+ ...jsxAccessibility,
14
+ ...importPlugin,
15
+ ...unusedImports,
16
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import jsxA11y from "eslint-plugin-jsx-a11y";
2
+ export default [
3
+ jsxA11y.flatConfigs.recommended,
4
+ {
5
+ rules: {
6
+ "jsx-a11y/no-autofocus": "off",
7
+ },
8
+ },
9
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
package/dist/react.js ADDED
@@ -0,0 +1,27 @@
1
+ import react from "eslint-plugin-react";
2
+ import globals from "globals";
3
+ export default [
4
+ {
5
+ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
6
+ languageOptions: {
7
+ globals: {
8
+ ...globals.browser,
9
+ },
10
+ parserOptions: {
11
+ ecmaFeatures: {
12
+ jsx: true,
13
+ },
14
+ },
15
+ },
16
+ plugins: {
17
+ react,
18
+ },
19
+ rules: {
20
+ "react/jsx-no-literals": ["error", {
21
+ allowedStrings: [
22
+ "©",
23
+ ],
24
+ }],
25
+ },
26
+ },
27
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
@@ -0,0 +1,123 @@
1
+ import stylistic from "@stylistic/eslint-plugin";
2
+ export default [
3
+ {
4
+ plugins: {
5
+ "@stylistic": stylistic,
6
+ },
7
+ rules: {
8
+ "@stylistic/array-bracket-newline": ["error", "consistent"],
9
+ "@stylistic/array-bracket-spacing": ["error", "never"],
10
+ "@stylistic/array-element-newline": ["error", "consistent"],
11
+ "@stylistic/arrow-parens": ["error", "as-needed"],
12
+ "@stylistic/arrow-spacing": ["warn", { after: true, before: true }],
13
+ "@stylistic/block-spacing": ["error", "always"],
14
+ "@stylistic/brace-style": ["error", "1tbs"],
15
+ "@stylistic/comma-dangle": ["error", "always-multiline"],
16
+ "@stylistic/comma-spacing": ["error", { after: true, before: false }],
17
+ "@stylistic/comma-style": "error",
18
+ "@stylistic/computed-property-spacing": ["error", "never"],
19
+ "@stylistic/dot-location": ["error", "property"],
20
+ "@stylistic/eol-last": ["error", "always"],
21
+ "@stylistic/function-call-argument-newline": ["error", "consistent"],
22
+ "@stylistic/function-call-spacing": ["error", "never"],
23
+ "@stylistic/function-paren-newline": ["error", "multiline"],
24
+ "@stylistic/generator-star-spacing": ["error", "both"],
25
+ "@stylistic/implicit-arrow-linebreak": ["error", "beside"],
26
+ "@stylistic/indent": ["error", 2, { SwitchCase: 1 }],
27
+ "@stylistic/indent-binary-ops": "error",
28
+ "@stylistic/jsx-child-element-spacing": "error",
29
+ "@stylistic/jsx-closing-bracket-location": ["error", "tag-aligned"],
30
+ "@stylistic/jsx-closing-tag-location": "error",
31
+ "@stylistic/jsx-curly-brace-presence": ["error", {
32
+ children: "never",
33
+ propElementValues: "always",
34
+ props: "never",
35
+ }],
36
+ "@stylistic/jsx-curly-newline": ["error", {
37
+ multiline: "consistent",
38
+ singleline: "consistent",
39
+ }],
40
+ "@stylistic/jsx-curly-spacing": ["error", { when: "never" }],
41
+ "@stylistic/jsx-equals-spacing": ["error", "never"],
42
+ "@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
43
+ "@stylistic/jsx-indent": ["error", 2],
44
+ "@stylistic/jsx-indent-props": ["error", 2],
45
+ "@stylistic/jsx-max-props-per-line": ["error", { maximum: { multi: 1, single: 4 } }],
46
+ "@stylistic/jsx-newline": ["error", { allowMultilines: false, prevent: true }],
47
+ "@stylistic/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
48
+ "@stylistic/jsx-props-no-multi-spaces": "error",
49
+ "@stylistic/jsx-quotes": ["error", "prefer-double"],
50
+ "@stylistic/jsx-self-closing-comp": ["error", { component: true, html: true }],
51
+ "@stylistic/jsx-sort-props": "off",
52
+ "@stylistic/jsx-tag-spacing": "error",
53
+ "@stylistic/jsx-wrap-multilines": ["error", {
54
+ arrow: "parens-new-line",
55
+ assignment: "parens-new-line",
56
+ condition: "parens-new-line",
57
+ declaration: "parens-new-line",
58
+ logical: "parens-new-line",
59
+ prop: "parens-new-line",
60
+ return: "parens-new-line",
61
+ }],
62
+ "@stylistic/key-spacing": "error",
63
+ "@stylistic/keyword-spacing": "error",
64
+ "@stylistic/linebreak-style": ["error", "unix"],
65
+ "@stylistic/lines-around-comment": "off",
66
+ "@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
67
+ "@stylistic/max-len": ["warn", { code: 128 }],
68
+ "@stylistic/max-statements-per-line": ["error", { max: 1 }],
69
+ "@stylistic/member-delimiter-style": ["error", {
70
+ multiline: { delimiter: "comma", requireLast: true },
71
+ multilineDetection: "brackets",
72
+ singleline: { delimiter: "comma", requireLast: false },
73
+ }],
74
+ "@stylistic/multiline-ternary": "off",
75
+ "@stylistic/new-parens": ["error", "always"],
76
+ "@stylistic/newline-per-chained-call": ["error", { ignoreChainWithDepth: 3 }],
77
+ "@stylistic/no-confusing-arrow": "error",
78
+ "@stylistic/no-extra-parens": "off",
79
+ "@stylistic/no-extra-semi": "error",
80
+ "@stylistic/no-floating-decimal": "error",
81
+ "@stylistic/no-mixed-operators": "error",
82
+ "@stylistic/no-mixed-spaces-and-tabs": "error",
83
+ "@stylistic/no-multi-spaces": "error",
84
+ "@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxBOF: 0, maxEOF: 1 }],
85
+ "@stylistic/no-tabs": "error",
86
+ "@stylistic/no-trailing-spaces": "error",
87
+ "@stylistic/no-whitespace-before-property": "error",
88
+ "@stylistic/nonblock-statement-body-position": ["error", "beside"],
89
+ "@stylistic/object-curly-newline": "error",
90
+ "@stylistic/object-curly-spacing": ["error", "always"],
91
+ "@stylistic/object-property-newline": "off",
92
+ "@stylistic/one-var-declaration-per-line": ["error", "initializations"],
93
+ "@stylistic/operator-linebreak": "error",
94
+ "@stylistic/padded-blocks": ["error", "never"],
95
+ "@stylistic/padding-line-between-statements": "error",
96
+ "@stylistic/quote-props": ["error", "consistent-as-needed"],
97
+ "@stylistic/quotes": ["error", "double", { avoidEscape: true }],
98
+ "@stylistic/rest-spread-spacing": ["error", "never"],
99
+ "@stylistic/semi": ["error", "always"],
100
+ "@stylistic/semi-spacing": ["error", { after: true, before: false }],
101
+ "@stylistic/semi-style": "error",
102
+ "@stylistic/space-before-blocks": "error",
103
+ "@stylistic/space-before-function-paren": ["error", {
104
+ anonymous: "never",
105
+ asyncArrow: "always",
106
+ named: "never",
107
+ }],
108
+ "@stylistic/space-in-parens": "error",
109
+ "@stylistic/space-infix-ops": "error",
110
+ "@stylistic/space-unary-ops": "error",
111
+ "@stylistic/spaced-comment": "error",
112
+ "@stylistic/switch-colon-spacing": ["error", { after: true, before: false }],
113
+ "@stylistic/template-curly-spacing": ["error", "never"],
114
+ "@stylistic/template-tag-spacing": ["error", "never"],
115
+ "@stylistic/type-annotation-spacing": "error",
116
+ "@stylistic/type-generic-spacing": "error",
117
+ "@stylistic/type-named-tuple-spacing": "error",
118
+ "@stylistic/wrap-iife": ["error", "outside"],
119
+ "@stylistic/wrap-regex": "error",
120
+ "@stylistic/yield-star-spacing": ["error", "both"],
121
+ },
122
+ },
123
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import parser from "@typescript-eslint/parser";
2
+ import tseslint from "typescript-eslint";
3
+ export default [
4
+ ...tseslint.configs.recommended,
5
+ {
6
+ files: ["**/*.ts"],
7
+ languageOptions: {
8
+ parser,
9
+ parserOptions: {
10
+ project: "./tsconfig.json",
11
+ },
12
+ },
13
+ rules: {
14
+ "@typescript-eslint/adjacent-overload-signatures": "error",
15
+ "@typescript-eslint/array-type": "error",
16
+ "@typescript-eslint/ban-ts-comment": "warn",
17
+ "@typescript-eslint/ban-tslint-comment": "warn",
18
+ "@typescript-eslint/class-methods-use-this": "error",
19
+ "@typescript-eslint/consistent-indexed-object-style": "error",
20
+ "@typescript-eslint/consistent-type-exports": "error",
21
+ "@typescript-eslint/consistent-type-imports": "error",
22
+ "@typescript-eslint/dot-notation": "error",
23
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
24
+ "@typescript-eslint/no-unnecessary-condition": "error",
25
+ "@typescript-eslint/no-unused-vars": "off",
26
+ "@typescript-eslint/prefer-includes": "error",
27
+ "@typescript-eslint/prefer-nullish-coalescing": ["error", {
28
+ ignorePrimitives: {
29
+ string: true,
30
+ },
31
+ }],
32
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
33
+ "class-methods-use-this": "off",
34
+ "dot-notation": "off",
35
+ },
36
+ },
37
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config[];
3
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import unusedImports from "eslint-plugin-unused-imports";
2
+ export default [
3
+ {
4
+ plugins: {
5
+ "unused-imports": unusedImports,
6
+ },
7
+ rules: {
8
+ "unused-imports/no-unused-imports": "error",
9
+ "unused-imports/no-unused-vars": [
10
+ "warn",
11
+ { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" },
12
+ ],
13
+ },
14
+ },
15
+ ];
package/package.json CHANGED
@@ -1,39 +1,88 @@
1
1
  {
2
2
  "name": "@omer-x/eslint-config",
3
- "version": "1.0.6",
3
+ "version": "2.0.0",
4
4
  "description": "My favorite eslint rules",
5
- "author": "Omer Mecitoglu",
6
- "license": "MIT",
7
5
  "keywords": [
8
- "eslint",
9
- "config"
6
+ "eslint-config",
7
+ "shareable-config"
10
8
  ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/omermecitoglu/eslint-config.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/omermecitoglu/eslint-config/issues"
15
+ },
16
+ "homepage": "https://github.com/omermecitoglu/eslint-config#readme",
11
17
  "private": false,
12
18
  "publishConfig": {
13
19
  "access": "public"
14
20
  },
15
- "main": "index.js",
21
+ "author": {
22
+ "name": "Omer Mecitoglu",
23
+ "email": "omer.mecitoglu@gmail.com",
24
+ "url": "https://omermecitoglu.github.io"
25
+ },
26
+ "license": "MIT",
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./dist/index.js",
32
+ "types": "./dist/index.d.ts"
33
+ },
34
+ "./base": {
35
+ "import": "./dist/base.js",
36
+ "types": "./dist/base.d.ts"
37
+ },
38
+ "./stylistic": {
39
+ "import": "./dist/stylistic.js",
40
+ "types": "./dist/stylistic.d.ts"
41
+ },
42
+ "./typescript": {
43
+ "import": "./dist/typescript.js",
44
+ "types": "./dist/typescript.d.ts"
45
+ },
46
+ "./react": {
47
+ "import": "./dist/react.js",
48
+ "types": "./dist/react.d.ts"
49
+ },
50
+ "./jsx-a11y": {
51
+ "import": "./dist/jsx-a11y.js",
52
+ "types": "./dist/jsx-a11y.d.ts"
53
+ },
54
+ "./import": {
55
+ "import": "./dist/import.js",
56
+ "types": "./dist/import.d.ts"
57
+ },
58
+ "./unused-imports": {
59
+ "import": "./dist/unused-imports.js",
60
+ "types": "./dist/unused-imports.d.ts"
61
+ }
62
+ },
16
63
  "files": [
17
- "base.js",
18
- "index.js",
19
- "jsx.js",
20
- "stylistic.js",
21
- "typescript.js"
64
+ "dist/"
22
65
  ],
23
66
  "scripts": {
67
+ "build": "tsc",
24
68
  "lint": "eslint"
25
69
  },
26
70
  "peerDependencies": {
27
- "eslint": ">= 8"
71
+ "eslint": ">= 9"
28
72
  },
29
73
  "dependencies": {
30
- "@stylistic/eslint-plugin": "^1.5.3",
31
- "@typescript-eslint/eslint-plugin": "^6.18.0",
32
- "eslint-plugin-import": "^2.29.1",
33
- "eslint-plugin-jsx-a11y": "^6.8.0",
34
- "eslint-plugin-unused-imports": "^3.0.0"
74
+ "@stylistic/eslint-plugin": "^2.8.0",
75
+ "@typescript-eslint/parser": "^8.8.0",
76
+ "eslint-plugin-import": "^2.31.0",
77
+ "eslint-plugin-jsx-a11y": "^6.10.0",
78
+ "eslint-plugin-react": "^7.37.1",
79
+ "eslint-plugin-unused-imports": "^4.1.4",
80
+ "typescript-eslint": "^8.8.0"
35
81
  },
36
82
  "devDependencies": {
37
- "eslint": "^8.56.0"
83
+ "@types/eslint__js": "^8.42.3",
84
+ "@types/eslint-plugin-jsx-a11y": "^6.9.0",
85
+ "eslint": "^9.11.1",
86
+ "typescript": "^5.6.2"
38
87
  }
39
88
  }
package/base.js DELETED
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "eslint:recommended",
4
- ],
5
- rules: {
6
- "array-callback-return": "error",
7
- "class-methods-use-this": "error",
8
- "curly": ["error", "multi-line", "consistent"],
9
- "dot-notation": "error",
10
- "eqeqeq": "error",
11
- "line-comment-position": "off",
12
- "max-nested-callbacks": ["error", { max: 4 }],
13
- "max-statements-per-line": ["error", { max: 2 }],
14
- "no-console": "warn",
15
- "no-duplicate-imports": "error",
16
- "no-empty-function": "error",
17
- "no-lonely-if": "error",
18
- "no-shadow": ["error", { allow: ["err", "resolve", "reject"] }],
19
- "no-var": "error",
20
- "prefer-const": "error",
21
- "require-await": "warn",
22
- "sort-imports": ["error", { ignoreDeclarationSort: true }],
23
- "unicode-bom": ["error", "never"],
24
- "yoda": "error",
25
- },
26
- };
package/index.js DELETED
@@ -1,31 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "./base",
4
- "./stylistic",
5
- "./jsx",
6
- ],
7
- plugins: [
8
- "import",
9
- "unused-imports",
10
- ],
11
- rules: {
12
- "import/order": [
13
- "error",
14
- {
15
- alphabetize: {
16
- caseInsensitive: false,
17
- order: "asc",
18
- },
19
- groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type", "object"],
20
- pathGroups: [
21
- { group: "internal", pattern: "~/**" },
22
- ],
23
- },
24
- ],
25
- "unused-imports/no-unused-imports": "error",
26
- "unused-imports/no-unused-vars": [
27
- "warn",
28
- { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" },
29
- ],
30
- },
31
- };
package/jsx.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:jsx-a11y/recommended",
4
- ],
5
- plugins: [
6
- "jsx-a11y",
7
- ],
8
- rules: {
9
- "jsx-a11y/no-autofocus": "off",
10
- },
11
- };
package/stylistic.js DELETED
@@ -1,120 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- "@stylistic",
4
- ],
5
- rules: {
6
- "@stylistic/array-bracket-newline": ["error", "consistent"],
7
- "@stylistic/array-bracket-spacing": ["error", "never"],
8
- "@stylistic/array-element-newline": ["error", "consistent"],
9
- "@stylistic/arrow-parens": ["error", "as-needed"],
10
- "@stylistic/arrow-spacing": ["warn", { after: true, before: true }],
11
- "@stylistic/block-spacing": ["error", "always"],
12
- "@stylistic/brace-style": ["error", "1tbs"],
13
- "@stylistic/comma-dangle": ["error", "always-multiline"],
14
- "@stylistic/comma-spacing": ["error", { after: true, before: false }],
15
- "@stylistic/comma-style": "error",
16
- "@stylistic/computed-property-spacing": ["error", "never"],
17
- "@stylistic/dot-location": ["error", "property"],
18
- "@stylistic/eol-last": ["error", "always"],
19
- "@stylistic/function-call-argument-newline": ["error", "consistent"],
20
- "@stylistic/function-call-spacing": ["error", "never"],
21
- "@stylistic/function-paren-newline": ["error", "multiline"],
22
- "@stylistic/generator-star-spacing": ["error", "both"],
23
- "@stylistic/implicit-arrow-linebreak": ["error", "beside"],
24
- "@stylistic/indent": ["error", 2, { SwitchCase: 1 }],
25
- "@stylistic/indent-binary-ops": "error",
26
- "@stylistic/jsx-child-element-spacing": "error",
27
- "@stylistic/jsx-closing-bracket-location": ["error", "tag-aligned"],
28
- "@stylistic/jsx-closing-tag-location": "error",
29
- "@stylistic/jsx-curly-brace-presence": ["error", {
30
- children: "never",
31
- propElementValues: "always",
32
- props: "never",
33
- }],
34
- "@stylistic/jsx-curly-newline": ["error", {
35
- multiline: "consistent",
36
- singleline: "consistent",
37
- }],
38
- "@stylistic/jsx-curly-spacing": ["error", { when: "never" }],
39
- "@stylistic/jsx-equals-spacing": ["error", "never"],
40
- "@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
41
- "@stylistic/jsx-indent": ["error", 2],
42
- "@stylistic/jsx-indent-props": ["error", 2],
43
- "@stylistic/jsx-max-props-per-line": ["error", { maximum: { multi: 1, single: 4 } }],
44
- "@stylistic/jsx-newline": ["error", { allowMultilines: false, prevent: true }],
45
- "@stylistic/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
46
- "@stylistic/jsx-props-no-multi-spaces": "error",
47
- "@stylistic/jsx-quotes": ["error", "prefer-double"],
48
- "@stylistic/jsx-self-closing-comp": ["error", { component: true, html: true }],
49
- "@stylistic/jsx-sort-props": "off",
50
- "@stylistic/jsx-tag-spacing": "error",
51
- "@stylistic/jsx-wrap-multilines": ["error", {
52
- arrow: "parens-new-line",
53
- assignment: "parens-new-line",
54
- condition: "parens-new-line",
55
- declaration: "parens-new-line",
56
- logical: "parens-new-line",
57
- prop: "parens-new-line",
58
- return: "parens-new-line",
59
- }],
60
- "@stylistic/key-spacing": "error",
61
- "@stylistic/keyword-spacing": "error",
62
- "@stylistic/linebreak-style": ["error", "unix"],
63
- "@stylistic/lines-around-comment": "off",
64
- "@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
65
- "@stylistic/max-len": ["warn", { code: 128 }],
66
- "@stylistic/max-statements-per-line": ["error", { max: 1 }],
67
- "@stylistic/member-delimiter-style": ["error", {
68
- multiline: { delimiter: "comma", requireLast: true },
69
- multilineDetection: "brackets",
70
- singleline: { delimiter: "comma", requireLast: false },
71
- }],
72
- "@stylistic/multiline-ternary": "off",
73
- "@stylistic/new-parens": ["error", "always"],
74
- "@stylistic/newline-per-chained-call": ["error", { ignoreChainWithDepth: 3 }],
75
- "@stylistic/no-confusing-arrow": "error",
76
- "@stylistic/no-extra-parens": "off",
77
- "@stylistic/no-extra-semi": "error",
78
- "@stylistic/no-floating-decimal": "error",
79
- "@stylistic/no-mixed-operators": "error",
80
- "@stylistic/no-mixed-spaces-and-tabs": "error",
81
- "@stylistic/no-multi-spaces": "error",
82
- "@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxBOF: 0, maxEOF: 1 }],
83
- "@stylistic/no-tabs": "error",
84
- "@stylistic/no-trailing-spaces": "error",
85
- "@stylistic/no-whitespace-before-property": "error",
86
- "@stylistic/nonblock-statement-body-position": ["error", "beside"],
87
- "@stylistic/object-curly-newline": "error",
88
- "@stylistic/object-curly-spacing": ["error", "always"],
89
- "@stylistic/object-property-newline": "off",
90
- "@stylistic/one-var-declaration-per-line": ["error", "initializations"],
91
- "@stylistic/operator-linebreak": "error",
92
- "@stylistic/padded-blocks": ["error", "never"],
93
- "@stylistic/padding-line-between-statements": "error",
94
- "@stylistic/quote-props": ["error", "consistent-as-needed"],
95
- "@stylistic/quotes": ["error", "double", { avoidEscape: true }],
96
- "@stylistic/rest-spread-spacing": ["error", "never"],
97
- "@stylistic/semi": ["error", "always"],
98
- "@stylistic/semi-spacing": ["error", { after: true, before: false }],
99
- "@stylistic/semi-style": "error",
100
- "@stylistic/space-before-blocks": "error",
101
- "@stylistic/space-before-function-paren": ["error", {
102
- anonymous: "never",
103
- asyncArrow: "always",
104
- named: "never",
105
- }],
106
- "@stylistic/space-in-parens": "error",
107
- "@stylistic/space-infix-ops": "error",
108
- "@stylistic/space-unary-ops": "error",
109
- "@stylistic/spaced-comment": "error",
110
- "@stylistic/switch-colon-spacing": ["error", { after: true, before: false }],
111
- "@stylistic/template-curly-spacing": ["error", "never"],
112
- "@stylistic/template-tag-spacing": ["error", "never"],
113
- "@stylistic/type-annotation-spacing": "error",
114
- "@stylistic/type-generic-spacing": "error",
115
- "@stylistic/type-named-tuple-spacing": "error",
116
- "@stylistic/wrap-iife": ["error", "outside"],
117
- "@stylistic/wrap-regex": "error",
118
- "@stylistic/yield-star-spacing": ["error", "both"],
119
- },
120
- };
package/typescript.js DELETED
@@ -1,31 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:@typescript-eslint/recommended",
4
- ],
5
- plugins: [
6
- "@typescript-eslint",
7
- ],
8
- rules: {
9
- "@typescript-eslint/adjacent-overload-signatures": "error",
10
- "@typescript-eslint/array-type": "error",
11
- "@typescript-eslint/ban-ts-comment": "warn",
12
- "@typescript-eslint/ban-tslint-comment": "warn",
13
- "@typescript-eslint/class-methods-use-this": "error",
14
- "@typescript-eslint/consistent-indexed-object-style": "error",
15
- "@typescript-eslint/consistent-type-exports": "error",
16
- "@typescript-eslint/consistent-type-imports": "error",
17
- "@typescript-eslint/dot-notation": "error",
18
- "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
19
- "@typescript-eslint/no-unnecessary-condition": "error",
20
- "@typescript-eslint/no-unused-vars": "off",
21
- "@typescript-eslint/prefer-includes": "error",
22
- "@typescript-eslint/prefer-nullish-coalescing": ["error", {
23
- ignorePrimitives: {
24
- string: true,
25
- },
26
- }],
27
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
28
- "class-methods-use-this": "off",
29
- "dot-notation": "off",
30
- },
31
- };