@jsimck/eslint-config 3.0.0-next.1 → 3.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 +1 -5
- package/package.json +4 -2
- package/src/configs/base.js +0 -3
- package/src/configs/import.js +0 -3
- package/src/configs/javascript.js +0 -3
- package/src/configs/sonarjs.js +10 -1
- package/src/configs/sortClassMembers.js +0 -3
- package/src/configs/unicorn.js +0 -1
- package/src/configs/unusedImports.js +0 -3
package/README.md
CHANGED
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Opinionated shareable ESLint flat config for JavaScript/TypeScript projects, including React, import ordering, SonarJS, Unicorn, and Prettier.
|
|
4
4
|
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- `eslint >= 10`
|
|
8
|
-
|
|
9
5
|
## Install
|
|
10
6
|
|
|
11
7
|
```bash
|
|
12
|
-
pnpm add -D eslint@
|
|
8
|
+
pnpm add -D eslint@9 @jsimck/eslint-config
|
|
13
9
|
```
|
|
14
10
|
|
|
15
11
|
## Usage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsimck/eslint-config",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Very opinionated eslint config I use on my projects, includes: prettier, TS, vitest, sonarqube and unicorn. And many others.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"release": "changeset publish",
|
|
49
49
|
"release:next": "changeset publish",
|
|
50
50
|
"changeset": "changeset add",
|
|
51
|
-
"changeset:
|
|
51
|
+
"changeset:version": "changeset add",
|
|
52
|
+
"changeset:next:enter": "changeset pre enter next",
|
|
53
|
+
"changeset:next:exit": "changeset pre exit",
|
|
52
54
|
"lint": "eslint .",
|
|
53
55
|
"lint:fix": "pnpm lint --fix"
|
|
54
56
|
}
|
package/src/configs/base.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import stylistic from '@stylistic/eslint-plugin';
|
|
2
2
|
import globals from 'globals';
|
|
3
3
|
|
|
4
|
-
import { files } from '../utils/helpers.js';
|
|
5
|
-
|
|
6
4
|
export default [
|
|
7
5
|
{
|
|
8
6
|
ignores: [
|
|
@@ -20,7 +18,6 @@ export default [
|
|
|
20
18
|
],
|
|
21
19
|
},
|
|
22
20
|
{
|
|
23
|
-
files: [...files.js, ...files.ts],
|
|
24
21
|
plugins: {
|
|
25
22
|
'@stylistic': stylistic,
|
|
26
23
|
},
|
package/src/configs/import.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import importPlugin from 'eslint-plugin-import-x';
|
|
2
2
|
|
|
3
|
-
import { files } from '../utils/helpers.js';
|
|
4
|
-
|
|
5
3
|
/** @type {import('eslint').Linter.Config[]} */
|
|
6
4
|
const config = [
|
|
7
5
|
{
|
|
8
|
-
files: [...files.js, ...files.ts],
|
|
9
6
|
plugins: { 'import-x': importPlugin },
|
|
10
7
|
settings: {
|
|
11
8
|
'import-x/parsers': {
|
package/src/configs/sonarjs.js
CHANGED
|
@@ -4,10 +4,19 @@ import { files } from '../utils/helpers.js';
|
|
|
4
4
|
|
|
5
5
|
export default [
|
|
6
6
|
{
|
|
7
|
-
files: [...files.ts, ...files.js],
|
|
8
7
|
plugins: { sonarjs },
|
|
9
8
|
rules: {
|
|
10
9
|
...sonarjs.configs.recommended.rules,
|
|
10
|
+
'sonarjs/no-nested-functions': 'warn',
|
|
11
|
+
'sonarjs/slow-regex': 'warn',
|
|
12
|
+
'sonarjs/pseudo-random': 'off',
|
|
13
|
+
'sonarjs/fixme-tag': 'warn',
|
|
14
|
+
'sonarjs/redundant-type-aliases': 'warn',
|
|
15
|
+
'sonarjs/no-unused-vars': 'off',
|
|
16
|
+
'sonarjs/no-globals-shadowing': 'warn',
|
|
17
|
+
'sonarjs/no-clear-text-protocols': 'off',
|
|
18
|
+
'sonarjs/no-nested-conditional': 'off',
|
|
19
|
+
'sonarjs/todo-tag': 'warn',
|
|
11
20
|
'sonarjs/cognitive-complexity': 'warn',
|
|
12
21
|
'sonarjs/no-identical-functions': ['warn', 3],
|
|
13
22
|
'sonarjs/no-duplicate-string': ['warn', { threshold: 10 }],
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import sortClassMembers from 'eslint-plugin-sort-class-members';
|
|
2
2
|
|
|
3
|
-
import { files } from '../utils/helpers.js';
|
|
4
|
-
|
|
5
3
|
export default [
|
|
6
4
|
{
|
|
7
|
-
files: [...files.js, ...files.ts],
|
|
8
5
|
...sortClassMembers.configs['flat/recommended'],
|
|
9
6
|
rules: {
|
|
10
7
|
...sortClassMembers.configs['flat/recommended'].rules,
|
package/src/configs/unicorn.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
2
2
|
|
|
3
|
-
import { files } from '../utils/helpers.js';
|
|
4
|
-
|
|
5
3
|
export default [
|
|
6
4
|
{
|
|
7
|
-
files: [...files.js, ...files.ts],
|
|
8
5
|
plugins: { 'unused-imports': unusedImportsPlugin },
|
|
9
6
|
rules: {
|
|
10
7
|
'no-unused-vars': 'off',
|