@santi020k/eslint-config-santi020k 1.0.0 → 1.1.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
@@ -11,11 +11,14 @@ Welcome to @santi020k/eslint-config-santi020k, a comprehensive and opinionated E
11
11
 
12
12
  ## Links to Configurations
13
13
 
14
+ - [jsEslint](./src/js/README.md): For JavaScript projects.
15
+ - [tsEslint](./src/ts/README.md): For TypeScript projects.
14
16
  - [reactEslint](./src/react/README.md): For JavaScript and React projects.
15
17
  - [reactTsEslint](./src/react-ts/README.md): For TypeScript and React projects.
16
- - NextJS: Pending
17
- - Astro: Pending
18
- - NX: Pending
18
+ - [nextEslint](./src/next/README.md): For JavaScript and Next projects.
19
+ - [nextTsEslint](./src/next-ts/README.md): For TypeScript and Next projects.
20
+ - [astroEslint](./src/astro/README.md): For JavaScript and Astro projects. (Beta)
21
+ - [astroTsEslint](./src/astro-ts/README.md): For TypeScript and Astro projects. (Beta)
19
22
 
20
23
  ## Installation
21
24
 
@@ -33,6 +36,36 @@ Then, install the configuration package:
33
36
 
34
37
  ## Usage
35
38
 
39
+ ### For JavaScript Projects
40
+
41
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k`:
42
+
43
+ ```js
44
+ import { jsEslint } from '@santi020k/eslint-config-santi020k'
45
+
46
+ export default [
47
+ ...jsEslint,
48
+ {
49
+ // Other rules or overrides
50
+ }
51
+ ]
52
+ ```
53
+
54
+ ### For TypeScript Projects
55
+
56
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k` with TypeScript support:
57
+
58
+ ```js
59
+ import { tsConfig } from '@santi020k/eslint-config-santi020k'
60
+
61
+ export default [
62
+ ...tsConfig,
63
+ {
64
+ // Other rules or overrides
65
+ }
66
+ ]
67
+ ```
68
+
36
69
  ### For JavaScript and React Projects
37
70
 
38
71
  Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k`:
@@ -52,12 +85,75 @@ Create an `eslint.config.js` file (or use your existing one) and extend `@santi0
52
85
 
53
86
  Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k` with TypeScript support:
54
87
 
88
+ ```js
89
+ import { reactTsEslint } from '@santi020k/eslint-config-santi020k'
90
+
91
+ export default [
92
+ ...reactTsEslint,
93
+ {
94
+ // Other rules or overrides
95
+ }
96
+ ]
97
+ ```
98
+
99
+ ### For JavaScript and Next Projects
100
+
101
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k`:
55
102
 
56
103
  ```js
57
- import { reactTsConfig } from '@santi020k/eslint-config-santi020k'
104
+ import { nextEslint } from '@santi020k/eslint-config-santi020k'
58
105
 
59
106
  export default [
60
- ...reactTsConfig,
107
+ ...nextEslint,
108
+ {
109
+ // Other rules or overrides
110
+ }
111
+ ]
112
+ ```
113
+
114
+ ### For TypeScript and Next Projects
115
+
116
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k` with TypeScript support:
117
+
118
+ ```js
119
+ import { nextTsEslint } from '@santi020k/eslint-config-santi020k'
120
+
121
+ export default [
122
+ ...nextTsEslint,
123
+ {
124
+ // Other rules or overrides
125
+ }
126
+ ]
127
+ ```
128
+
129
+ ### For JavaScript and Astro Projects
130
+
131
+ (It is currently a beta implementation and only supports astro with react)
132
+
133
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k`:
134
+
135
+ ```js
136
+ import { astroEslint } from '@santi020k/eslint-config-santi020k'
137
+
138
+ export default [
139
+ ...astroEslint,
140
+ {
141
+ // Other rules or overrides
142
+ }
143
+ ]
144
+ ```
145
+
146
+ ### For TypeScript and Astro Projects
147
+
148
+ (It is currently a beta implementation and only supports astro with react)
149
+
150
+ Create an `eslint.config.js` file (or use your existing one) and extend `@santi020k/eslint-config-santi020k` with TypeScript support:
151
+
152
+ ```js
153
+ import { astroTsEslint } from '@santi020k/eslint-config-santi020k'
154
+
155
+ export default [
156
+ ...astroTsEslint,
61
157
  {
62
158
  // Other rules or overrides
63
159
  }
@@ -94,6 +190,12 @@ Here are some useful scripts you can add to your `package.json`:
94
190
 
95
191
  4. Adjust as Necessary: Review the linting rules and adjust them based on your project's needs. Since this configuration is opinionated, some rules might be too strict or not applicable to your project. Feel free to disable or modify them.
96
192
 
193
+ ## Future
194
+
195
+ [ ] Unit testing
196
+ [ ] Better documentation
197
+ [ ] Additional Frameworks support
198
+
97
199
  ## Contributing
98
200
 
99
201
  If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/santi020k/eslint-config-santi020k).
@@ -114,6 +216,7 @@ I would like to express my gratitude to the developers and maintainers of the fo
114
216
  - `eslint-plugin-unused-imports`
115
217
  - `@stylistic/eslint-plugin`
116
218
  - `@typescript-eslint`
219
+ - etc...
117
220
 
118
221
  These tools have significantly contributed to the JavaScript and TypeScript ecosystem, and their continued development helps maintain the high standards of code quality that we all strive for.
119
222
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-santi020k",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.cjs",
@@ -19,15 +19,13 @@
19
19
  "/dist"
20
20
  ],
21
21
  "scripts": {
22
+ "dev": "rollup -c --watch",
22
23
  "build": "rollup -c",
23
24
  "lint": "eslint . --report-unused-disable-directives",
24
- "lint:fix": "npm run lint -- --fix",
25
- "prepare": "npm run build",
26
- "release:generate:latest": "eslint-generate-release",
27
- "release:generate:alpha": "eslint-generate-prerelease alpha",
28
- "release:generate:beta": "eslint-generate-prerelease beta",
29
- "release:generate:rc": "eslint-generate-prerelease rc",
30
- "release:publish": "eslint-publish-release",
25
+ "lint:fix": "npm run lint -- --fix --max-warnings=0",
26
+ "pre-commit": "lint-staged",
27
+ "pre-push": "npm run build && npm run lint:fix",
28
+ "prepare": "husky config/.husky",
31
29
  "test": "not yet"
32
30
  },
33
31
  "repository": {
@@ -49,7 +47,7 @@
49
47
  ],
50
48
  "license": "Apache License 2.0",
51
49
  "peerDependencies": {
52
- "eslint": "^9.3.0"
50
+ "eslint": "^9.4.0"
53
51
  },
54
52
  "publishConfig": {
55
53
  "access": "public"
@@ -60,8 +58,11 @@
60
58
  "devDependencies": {
61
59
  "@rollup/plugin-node-resolve": "^15.2.3",
62
60
  "@rollup/plugin-typescript": "^11.1.6",
63
- "@types/node": "^20.12.13",
61
+ "@types/node": "^20.13.0",
62
+ "cz-conventional-changelog": "^3.3.0",
64
63
  "esbuild": "^0.21.4",
64
+ "husky": "^9.0.11",
65
+ "lint-staged": "^15.2.5",
65
66
  "react": "^18.3.1",
66
67
  "react-dom": "^18.3.1",
67
68
  "rollup": "^4.18.0",
@@ -71,24 +72,27 @@
71
72
  "typescript": "^5.4.5"
72
73
  },
73
74
  "dependencies": {
74
- "@eslint/compat": "^1.0.1",
75
- "@eslint/js": "^9.3.0",
75
+ "@eslint/compat": "^1.0.3",
76
+ "@eslint/js": "^9.4.0",
77
+ "@next/eslint-plugin-next": "^14.2.3",
76
78
  "@stylistic/eslint-plugin": "^2.1.0",
77
79
  "@types/eslint__js": "^8.42.3",
80
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
81
+ "@typescript-eslint/type-utils": "^7.11.0",
78
82
  "eslint-config-standard": "^17.1.0",
83
+ "eslint-plugin-astro": "^1.2.0",
79
84
  "eslint-plugin-import": "^2.29.1",
80
85
  "eslint-plugin-jsx-a11y": "^6.8.0",
86
+ "eslint-plugin-mdx": "^3.1.5",
81
87
  "eslint-plugin-n": "^17.7.0",
82
88
  "eslint-plugin-promise": "^6.2.0",
83
89
  "eslint-plugin-react": "^7.34.2",
84
90
  "eslint-plugin-react-hooks": "^4.6.2",
85
91
  "eslint-plugin-simple-import-sort": "^12.1.0",
86
92
  "eslint-plugin-sonarjs": "^1.0.3",
87
- "eslint-plugin-unused-imports": "^3.2.0",
93
+ "eslint-plugin-unused-imports": "^4.0.0",
88
94
  "globals": "^15.3.0",
89
- "typescript-eslint": "^7.11.0",
90
- "@typescript-eslint/eslint-plugin": "^7.11.0",
91
- "@typescript-eslint/type-utils": "^7.11.0"
95
+ "typescript-eslint": "^7.11.0"
92
96
  },
93
97
  "overrides": {
94
98
  "eslint-config-standard": "$eslint-config-standard",
@@ -97,5 +101,15 @@
97
101
  "@typescript-eslint/eslint-plugin": "$@typescript-eslint/eslint-plugin",
98
102
  "@typescript-eslint/type-utils": "$@typescript-eslint/type-utils",
99
103
  "eslint": "$eslint"
104
+ },
105
+ "lint-staged": {
106
+ "*.{js, jsx, ts, tsx, md}": [
107
+ "npm run lint:fix"
108
+ ]
109
+ },
110
+ "config": {
111
+ "commitizen": {
112
+ "path": "./node_modules/cz-conventional-changelog"
113
+ }
100
114
  }
101
- }
115
+ }
@@ -1,261 +0,0 @@
1
- 'use strict';
2
-
3
- var compat = require('@eslint/compat');
4
- var eslint = require('@eslint/js');
5
- var pluginStylistic = require('@stylistic/eslint-plugin');
6
- var configStandard = require('eslint-config-standard');
7
- var pluginImport = require('eslint-plugin-import');
8
- var pluginJsxA11y = require('eslint-plugin-jsx-a11y');
9
- var pluginN = require('eslint-plugin-n');
10
- var pluginPromise = require('eslint-plugin-promise');
11
- var pluginReactConfig = require('eslint-plugin-react/configs/recommended.js');
12
- var pluginReactHooks = require('eslint-plugin-react-hooks');
13
- var pluginSimpleImport = require('eslint-plugin-simple-import-sort');
14
- var pluginSonarjs = require('eslint-plugin-sonarjs');
15
- var pluginUnusedImport = require('eslint-plugin-unused-imports');
16
- var globals = require('globals');
17
- var tseslint = require('typescript-eslint');
18
-
19
- const rules$1 = {
20
- "react/react-in-jsx-scope": "off",
21
- "react/jsx-max-depth": ["warn", { max: 7 }],
22
- "react/prop-types": "off",
23
- "unused-imports/no-unused-imports": "warn",
24
- "react-hooks/exhaustive-deps": "off",
25
- "@stylistic/indent": ["warn", 2],
26
- "@stylistic/quote-props": ["warn", "as-needed"],
27
- quotes: "off",
28
- "@stylistic/quotes": ["warn", "single"],
29
- "@stylistic/semi": ["warn", "never"],
30
- "@stylistic/comma-dangle": ["warn", "never"],
31
- "@stylistic/object-curly-spacing": ["warn", "always"],
32
- "@stylistic/padded-blocks": ["warn", "never"],
33
- "@stylistic/arrow-parens": ["warn", "as-needed"],
34
- "@stylistic/dot-location": ["warn", "property"],
35
- "@stylistic/function-call-argument-newline": ["warn", "never"],
36
- "@stylistic/object-property-newline": [
37
- "warn",
38
- { allowAllPropertiesOnSameLine: true }
39
- ],
40
- "@stylistic/multiline-ternary": ["warn", "always-multiline"],
41
- "@stylistic/member-delimiter-style": "off",
42
- "@stylistic/no-extra-parens": "off",
43
- "@stylistic/max-len": [
44
- "warn",
45
- {
46
- code: 120,
47
- tabWidth: 2,
48
- comments: 200,
49
- ignoreStrings: true
50
- }
51
- ],
52
- "@stylistic/max-statements-per-line": ["warn", { max: 1 }],
53
- "@stylistic/array-element-newline": ["warn", "consistent"],
54
- "@stylistic/no-extra-semi": "off",
55
- "@stylistic/no-multi-spaces": "off",
56
- "@stylistic/padding-line-between-statements": [
57
- "warn",
58
- { blankLine: "always", prev: "*", next: "*" },
59
- { blankLine: "any", prev: "import", next: "import" },
60
- {
61
- blankLine: "always",
62
- prev: ["const", "let", "var"],
63
- next: ["const", "let", "var"]
64
- },
65
- {
66
- blankLine: "never",
67
- prev: ["singleline-const", "singleline-let", "singleline-var"],
68
- next: ["singleline-const", "singleline-let", "singleline-var"]
69
- },
70
- { blankLine: "always", prev: "block-like", next: "const" },
71
- { blankLine: "always", prev: "const", next: "block-like" }
72
- ],
73
- "@stylistic/function-paren-newline": ["warn", "consistent"],
74
- "arrow-body-style": ["warn", "as-needed"],
75
- "prefer-arrow-callback": ["warn", { allowNamedFunctions: true }],
76
- "func-style": ["warn", "expression", { allowArrowFunctions: true }],
77
- "simple-import-sort/imports": [
78
- "warn",
79
- {
80
- groups: [
81
- // Packages `react` related packages come first.
82
- ["^react"],
83
- // Internal packages.
84
- ["^(store)(/.*|$)"],
85
- ["^(api)(/.*|$)"],
86
- ["^(components)(/.*|$)"],
87
- ["^(contexts)(/.*|$)"],
88
- ["^(hooks)(/.*|$)"],
89
- ["^(lib)(/.*|$)"],
90
- ["^(services)(/.*|$)"],
91
- ["^(models)(/.*|$)"],
92
- ["^(utils)(/.*|$)"],
93
- ["^(ws)(/.*|$)"],
94
- // Side effect imports.
95
- ["^\\u0000"],
96
- // Parent imports. Put `..` last.
97
- ["^\\.\\.(?!/?$)", "^\\.\\./?$"],
98
- // Other relative imports. Put same-folder imports and `.` last.
99
- ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
100
- // Style imports.
101
- ["^.+\\.?(css)$"]
102
- ]
103
- }
104
- ],
105
- "react/button-has-type": "warn",
106
- "react/display-name": "warn",
107
- "react/no-children-prop": "warn",
108
- "react/no-danger-with-children": "warn",
109
- "react/no-unstable-nested-components": "warn",
110
- "react/self-closing-comp": ["warn", { component: true, html: true }],
111
- "react/jsx-curly-brace-presence": [
112
- "warn",
113
- { props: "never", children: "never" }
114
- ],
115
- "react/jsx-curly-newline": "warn",
116
- "react/destructuring-assignment": "warn",
117
- "react/jsx-pascal-case": "warn",
118
- "react/boolean-prop-naming": "warn",
119
- "react/hook-use-state": "warn",
120
- "react/jsx-boolean-value": "warn",
121
- "react/jsx-closing-tag-location": "warn",
122
- "react/jsx-closing-bracket-location": "warn",
123
- "react/jsx-wrap-multilines": "warn",
124
- "react/jsx-no-target-blank": "warn",
125
- "react/jsx-no-leaked-render": "warn",
126
- "react/jsx-handler-names": "warn",
127
- "react/jsx-fragments": "warn",
128
- "react/no-deprecated": "warn",
129
- "react/no-multi-comp": "warn",
130
- "react/no-unescaped-entities": "warn",
131
- "jsx-a11y/alt-text": "warn",
132
- "no-empty": "warn",
133
- "no-nested-ternary": "warn",
134
- "no-undef": "warn",
135
- "unused-imports/no-unused-vars": [
136
- "warn",
137
- {
138
- vars: "all",
139
- varsIgnorePattern: "^_",
140
- args: "after-used",
141
- argsIgnorePattern: "^_",
142
- destructuredArrayIgnorePattern: "^_",
143
- ignoreRestSiblings: true
144
- }
145
- ],
146
- "no-void": "warn",
147
- camelcase: "warn",
148
- "react/jsx-no-undef": "warn",
149
- "array-callback-return": "warn",
150
- "no-fallthrough": "warn",
151
- eqeqeq: "warn",
152
- "no-constant-binary-expression": "warn",
153
- "@stylistic/lines-around-comment": "warn",
154
- "import/no-duplicates": "warn",
155
- "valid-typeof": "warn",
156
- "no-constant-condition": "warn",
157
- "no-use-before-define": "warn",
158
- "@stylistic/implicit-arrow-linebreak": "warn",
159
- "import/export": "warn",
160
- "no-useless-escape": "warn",
161
- "@stylistic/brace-style": "warn",
162
- "no-useless-return": "warn",
163
- "prefer-promise-reject-errors": "warn",
164
- "no-useless-constructor": "warn",
165
- "no-new": "warn",
166
- "prefer-regex-literals": "warn",
167
- "react/no-unknown-property": "warn",
168
- "@stylistic/multiline-comment-style": "off"
169
- };
170
-
171
- const reactConfig = [
172
- {
173
- name: "eslint-config",
174
- ...eslint.configs.recommended
175
- },
176
- {
177
- name: "plugins",
178
- plugins: {
179
- n: pluginN,
180
- import: pluginImport,
181
- promise: pluginPromise,
182
- "simple-import-sort": pluginSimpleImport,
183
- "jsx-a11y": pluginJsxA11y,
184
- "unused-imports": pluginUnusedImport,
185
- "react-rooks": pluginReactHooks,
186
- sonarjs: pluginSonarjs
187
- },
188
- rules: {
189
- ...configStandard.rules,
190
- ...pluginSonarjs.configs.recommended.rules
191
- }
192
- },
193
- {
194
- name: "stylistic",
195
- ...pluginStylistic.configs["recommended-flat"]
196
- // ...pluginStylistic.configs['all-flat']
197
- },
198
- ...compat.fixupConfigRules(pluginReactConfig).map((react) => ({
199
- ...react,
200
- name: "react"
201
- })),
202
- {
203
- name: "custom",
204
- languageOptions: {
205
- ecmaVersion: "latest",
206
- sourceType: "module",
207
- ...pluginReactConfig.languageOptions,
208
- globals: {
209
- ...globals.browser
210
- }
211
- },
212
- files: ["**/*.{js,jsx,mjs,cjs}"],
213
- settings: {
214
- react: {
215
- version: "detect"
216
- }
217
- },
218
- rules: rules$1
219
- }
220
- ];
221
-
222
- const rules = {
223
- ...rules$1,
224
- "@typescript-eslint/indent": 0,
225
- "@typescript-eslint/no-unused-vars": [
226
- "warn",
227
- {
228
- vars: "all",
229
- varsIgnorePattern: "^_",
230
- args: "after-used",
231
- argsIgnorePattern: "^_",
232
- destructuredArrayIgnorePattern: "^_",
233
- ignoreRestSiblings: true
234
- }
235
- ],
236
- "@typescript-eslint/no-explicit-any": "warn",
237
- "@typescript-eslint/no-empty-function": "warn",
238
- "@typescript-eslint/ban-types": "warn",
239
- "@typescript-eslint/no-var-requires": "warn",
240
- "@typescript-eslint/ban-ts-comment": "warn",
241
- "@typescript-eslint/no-non-null-assertion": "warn",
242
- "@typescript-eslint/no-invalid-void-type": "warn",
243
- "@typescript-eslint/no-dynamic-delete": "warn",
244
- "@typescript-eslint/no-useless-constructor": "warn",
245
- "@typescript-eslint/prefer-for-of": "warn",
246
- "@typescript-eslint/no-duplicate-enum-values": "warn"
247
- };
248
-
249
- const reactTsConfig = [
250
- ...reactConfig,
251
- ...tseslint.configs.strict,
252
- ...tseslint.configs.stylistic,
253
- {
254
- name: "ts-custom",
255
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
256
- rules
257
- }
258
- ];
259
-
260
- exports.reactEslint = reactConfig;
261
- exports.reactTsEslint = reactTsConfig;
@@ -1,2 +0,0 @@
1
- import reactEslint from './react-eslint.config';
2
- export { reactEslint };
@@ -1,2 +0,0 @@
1
- declare const _default: any[];
2
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const TodoApp: React.FC;
3
- export default TodoApp;
@@ -1,259 +0,0 @@
1
- // @ts-self-types="./index.d.ts"
2
- import { fixupConfigRules } from '@eslint/compat';
3
- import eslint from '@eslint/js';
4
- import pluginStylistic from '@stylistic/eslint-plugin';
5
- import configStandard from 'eslint-config-standard';
6
- import pluginImport from 'eslint-plugin-import';
7
- import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
8
- import pluginN from 'eslint-plugin-n';
9
- import pluginPromise from 'eslint-plugin-promise';
10
- import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
11
- import pluginReactHooks from 'eslint-plugin-react-hooks';
12
- import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
13
- import pluginSonarjs from 'eslint-plugin-sonarjs';
14
- import pluginUnusedImport from 'eslint-plugin-unused-imports';
15
- import globals from 'globals';
16
- import tseslint from 'typescript-eslint';
17
-
18
- const rules$1 = {
19
- "react/react-in-jsx-scope": "off",
20
- "react/jsx-max-depth": ["warn", { max: 7 }],
21
- "react/prop-types": "off",
22
- "unused-imports/no-unused-imports": "warn",
23
- "react-hooks/exhaustive-deps": "off",
24
- "@stylistic/indent": ["warn", 2],
25
- "@stylistic/quote-props": ["warn", "as-needed"],
26
- quotes: "off",
27
- "@stylistic/quotes": ["warn", "single"],
28
- "@stylistic/semi": ["warn", "never"],
29
- "@stylistic/comma-dangle": ["warn", "never"],
30
- "@stylistic/object-curly-spacing": ["warn", "always"],
31
- "@stylistic/padded-blocks": ["warn", "never"],
32
- "@stylistic/arrow-parens": ["warn", "as-needed"],
33
- "@stylistic/dot-location": ["warn", "property"],
34
- "@stylistic/function-call-argument-newline": ["warn", "never"],
35
- "@stylistic/object-property-newline": [
36
- "warn",
37
- { allowAllPropertiesOnSameLine: true }
38
- ],
39
- "@stylistic/multiline-ternary": ["warn", "always-multiline"],
40
- "@stylistic/member-delimiter-style": "off",
41
- "@stylistic/no-extra-parens": "off",
42
- "@stylistic/max-len": [
43
- "warn",
44
- {
45
- code: 120,
46
- tabWidth: 2,
47
- comments: 200,
48
- ignoreStrings: true
49
- }
50
- ],
51
- "@stylistic/max-statements-per-line": ["warn", { max: 1 }],
52
- "@stylistic/array-element-newline": ["warn", "consistent"],
53
- "@stylistic/no-extra-semi": "off",
54
- "@stylistic/no-multi-spaces": "off",
55
- "@stylistic/padding-line-between-statements": [
56
- "warn",
57
- { blankLine: "always", prev: "*", next: "*" },
58
- { blankLine: "any", prev: "import", next: "import" },
59
- {
60
- blankLine: "always",
61
- prev: ["const", "let", "var"],
62
- next: ["const", "let", "var"]
63
- },
64
- {
65
- blankLine: "never",
66
- prev: ["singleline-const", "singleline-let", "singleline-var"],
67
- next: ["singleline-const", "singleline-let", "singleline-var"]
68
- },
69
- { blankLine: "always", prev: "block-like", next: "const" },
70
- { blankLine: "always", prev: "const", next: "block-like" }
71
- ],
72
- "@stylistic/function-paren-newline": ["warn", "consistent"],
73
- "arrow-body-style": ["warn", "as-needed"],
74
- "prefer-arrow-callback": ["warn", { allowNamedFunctions: true }],
75
- "func-style": ["warn", "expression", { allowArrowFunctions: true }],
76
- "simple-import-sort/imports": [
77
- "warn",
78
- {
79
- groups: [
80
- // Packages `react` related packages come first.
81
- ["^react"],
82
- // Internal packages.
83
- ["^(store)(/.*|$)"],
84
- ["^(api)(/.*|$)"],
85
- ["^(components)(/.*|$)"],
86
- ["^(contexts)(/.*|$)"],
87
- ["^(hooks)(/.*|$)"],
88
- ["^(lib)(/.*|$)"],
89
- ["^(services)(/.*|$)"],
90
- ["^(models)(/.*|$)"],
91
- ["^(utils)(/.*|$)"],
92
- ["^(ws)(/.*|$)"],
93
- // Side effect imports.
94
- ["^\\u0000"],
95
- // Parent imports. Put `..` last.
96
- ["^\\.\\.(?!/?$)", "^\\.\\./?$"],
97
- // Other relative imports. Put same-folder imports and `.` last.
98
- ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
99
- // Style imports.
100
- ["^.+\\.?(css)$"]
101
- ]
102
- }
103
- ],
104
- "react/button-has-type": "warn",
105
- "react/display-name": "warn",
106
- "react/no-children-prop": "warn",
107
- "react/no-danger-with-children": "warn",
108
- "react/no-unstable-nested-components": "warn",
109
- "react/self-closing-comp": ["warn", { component: true, html: true }],
110
- "react/jsx-curly-brace-presence": [
111
- "warn",
112
- { props: "never", children: "never" }
113
- ],
114
- "react/jsx-curly-newline": "warn",
115
- "react/destructuring-assignment": "warn",
116
- "react/jsx-pascal-case": "warn",
117
- "react/boolean-prop-naming": "warn",
118
- "react/hook-use-state": "warn",
119
- "react/jsx-boolean-value": "warn",
120
- "react/jsx-closing-tag-location": "warn",
121
- "react/jsx-closing-bracket-location": "warn",
122
- "react/jsx-wrap-multilines": "warn",
123
- "react/jsx-no-target-blank": "warn",
124
- "react/jsx-no-leaked-render": "warn",
125
- "react/jsx-handler-names": "warn",
126
- "react/jsx-fragments": "warn",
127
- "react/no-deprecated": "warn",
128
- "react/no-multi-comp": "warn",
129
- "react/no-unescaped-entities": "warn",
130
- "jsx-a11y/alt-text": "warn",
131
- "no-empty": "warn",
132
- "no-nested-ternary": "warn",
133
- "no-undef": "warn",
134
- "unused-imports/no-unused-vars": [
135
- "warn",
136
- {
137
- vars: "all",
138
- varsIgnorePattern: "^_",
139
- args: "after-used",
140
- argsIgnorePattern: "^_",
141
- destructuredArrayIgnorePattern: "^_",
142
- ignoreRestSiblings: true
143
- }
144
- ],
145
- "no-void": "warn",
146
- camelcase: "warn",
147
- "react/jsx-no-undef": "warn",
148
- "array-callback-return": "warn",
149
- "no-fallthrough": "warn",
150
- eqeqeq: "warn",
151
- "no-constant-binary-expression": "warn",
152
- "@stylistic/lines-around-comment": "warn",
153
- "import/no-duplicates": "warn",
154
- "valid-typeof": "warn",
155
- "no-constant-condition": "warn",
156
- "no-use-before-define": "warn",
157
- "@stylistic/implicit-arrow-linebreak": "warn",
158
- "import/export": "warn",
159
- "no-useless-escape": "warn",
160
- "@stylistic/brace-style": "warn",
161
- "no-useless-return": "warn",
162
- "prefer-promise-reject-errors": "warn",
163
- "no-useless-constructor": "warn",
164
- "no-new": "warn",
165
- "prefer-regex-literals": "warn",
166
- "react/no-unknown-property": "warn",
167
- "@stylistic/multiline-comment-style": "off"
168
- };
169
-
170
- const reactConfig = [
171
- {
172
- name: "eslint-config",
173
- ...eslint.configs.recommended
174
- },
175
- {
176
- name: "plugins",
177
- plugins: {
178
- n: pluginN,
179
- import: pluginImport,
180
- promise: pluginPromise,
181
- "simple-import-sort": pluginSimpleImport,
182
- "jsx-a11y": pluginJsxA11y,
183
- "unused-imports": pluginUnusedImport,
184
- "react-rooks": pluginReactHooks,
185
- sonarjs: pluginSonarjs
186
- },
187
- rules: {
188
- ...configStandard.rules,
189
- ...pluginSonarjs.configs.recommended.rules
190
- }
191
- },
192
- {
193
- name: "stylistic",
194
- ...pluginStylistic.configs["recommended-flat"]
195
- // ...pluginStylistic.configs['all-flat']
196
- },
197
- ...fixupConfigRules(pluginReactConfig).map((react) => ({
198
- ...react,
199
- name: "react"
200
- })),
201
- {
202
- name: "custom",
203
- languageOptions: {
204
- ecmaVersion: "latest",
205
- sourceType: "module",
206
- ...pluginReactConfig.languageOptions,
207
- globals: {
208
- ...globals.browser
209
- }
210
- },
211
- files: ["**/*.{js,jsx,mjs,cjs}"],
212
- settings: {
213
- react: {
214
- version: "detect"
215
- }
216
- },
217
- rules: rules$1
218
- }
219
- ];
220
-
221
- const rules = {
222
- ...rules$1,
223
- "@typescript-eslint/indent": 0,
224
- "@typescript-eslint/no-unused-vars": [
225
- "warn",
226
- {
227
- vars: "all",
228
- varsIgnorePattern: "^_",
229
- args: "after-used",
230
- argsIgnorePattern: "^_",
231
- destructuredArrayIgnorePattern: "^_",
232
- ignoreRestSiblings: true
233
- }
234
- ],
235
- "@typescript-eslint/no-explicit-any": "warn",
236
- "@typescript-eslint/no-empty-function": "warn",
237
- "@typescript-eslint/ban-types": "warn",
238
- "@typescript-eslint/no-var-requires": "warn",
239
- "@typescript-eslint/ban-ts-comment": "warn",
240
- "@typescript-eslint/no-non-null-assertion": "warn",
241
- "@typescript-eslint/no-invalid-void-type": "warn",
242
- "@typescript-eslint/no-dynamic-delete": "warn",
243
- "@typescript-eslint/no-useless-constructor": "warn",
244
- "@typescript-eslint/prefer-for-of": "warn",
245
- "@typescript-eslint/no-duplicate-enum-values": "warn"
246
- };
247
-
248
- const reactTsConfig = [
249
- ...reactConfig,
250
- ...tseslint.configs.strict,
251
- ...tseslint.configs.stylistic,
252
- {
253
- name: "ts-custom",
254
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
255
- rules
256
- }
257
- ];
258
-
259
- export { reactConfig as reactEslint, reactTsConfig as reactTsEslint };
@@ -1,2 +0,0 @@
1
- import reactEslint from './react-eslint.config';
2
- export { reactEslint };
@@ -1,2 +0,0 @@
1
- declare const _default: any[];
2
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const TodoApp: React.FC;
3
- export default TodoApp;
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export const __esModule: boolean;