@st1ggy/linter-config 1.0.36 → 1.0.38

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/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "main": "index.js",
7
- "scripts": {
8
- "postinstall": "node postinstall.js"
9
- },
10
7
  "repository": {
11
8
  "type": "git",
12
9
  "url": "git+https://github.com/St1ggy/linter-config.git"
@@ -32,10 +29,12 @@
32
29
  "eslint-plugin-prettier": "5.1.3",
33
30
  "eslint-plugin-react": "7.34.1",
34
31
  "eslint-plugin-react-hooks": "5.1.0-canary-fd0da3eef-20240404",
32
+ "eslint-plugin-sonarjs": "^1.0.3",
33
+ "eslint-plugin-unicorn": "52.0.0",
34
+ "gently-copy": "3.2.0",
35
35
  "prettier": "3.2.5",
36
36
  "typescript": "5.4.5",
37
- "typescript-eslint": "7.8.0",
38
- "gently-copy": "3.2.0"
37
+ "typescript-eslint": "7.8.0"
39
38
  },
40
39
  "type": "module"
41
40
  }
@@ -1,107 +1,5 @@
1
- import eslint from '@eslint/js'
2
- import prettierConfig from 'eslint-config-prettier'
3
- import importPlugin from 'eslint-plugin-import'
4
- import prettierPlugin from 'eslint-plugin-prettier'
1
+ import commonRules from './rules/rules.common.js'
2
+ import prettierRules from './rules/rules.prettier.js'
3
+ import unicornRules from './rules/rules.unicorn.js'
5
4
 
6
- export default [
7
- eslint.configs.recommended,
8
- prettierConfig,
9
- {
10
- plugins: {
11
- import: importPlugin,
12
- prettier: prettierPlugin,
13
- },
14
- rules: {
15
- 'no-console': 'warn',
16
- 'no-debugger': 'warn',
17
- 'prettier/prettier': 'error',
18
- 'object-curly-newline': 'off',
19
- 'operator-linebreak': 'off',
20
- 'function-paren-newline': 'off',
21
- 'no-confusing-arrow': 'off',
22
- 'newline-per-chained-call': 'off',
23
- indent: 'off',
24
- 'implicit-arrow-linebreak': 'off',
25
- 'no-undef': 'off',
26
- 'lines-between-class-members': [
27
- 'error',
28
- 'always',
29
- {
30
- exceptAfterSingleLine: true,
31
- },
32
- ],
33
- 'prefer-template': 'error',
34
- 'arrow-body-style': ['error', 'as-needed'],
35
- 'no-return-assign': 'off',
36
- 'newline-before-return': ['error'],
37
- radix: 'off',
38
- 'no-mixed-operators': 'off',
39
- 'max-len': [
40
- 'error',
41
- {
42
- code: 120,
43
- tabWidth: 2,
44
- ignoreComments: true,
45
- ignoreRegExpLiterals: true,
46
- ignoreStrings: true,
47
- ignoreTrailingComments: true,
48
- },
49
- ],
50
- camelcase: [
51
- 'error',
52
- {
53
- allow: ['Open_Sans'],
54
- },
55
- ],
56
- 'no-shadow': 'off',
57
- 'no-unused-vars': 'off',
58
- 'no-use-before-define': 'off',
59
- 'import/newline-after-import': 'error',
60
- 'sort-imports': [
61
- 'error',
62
- {
63
- ignoreDeclarationSort: true,
64
- },
65
- ],
66
- 'import/order': [
67
- 'error',
68
- {
69
- 'newlines-between': 'always',
70
- groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
71
- pathGroups: [
72
- {
73
- pattern: '@/**',
74
- group: 'external',
75
- position: 'after',
76
- },
77
- ],
78
- alphabetize: {
79
- order: 'asc',
80
- caseInsensitive: false,
81
- },
82
- },
83
- ],
84
- quotes: ['error', 'single'],
85
- 'import/no-duplicates': [
86
- 'error',
87
- {
88
- considerQueryString: true,
89
- },
90
- ],
91
- 'object-shorthand': 'error',
92
- 'prefer-const': 'error',
93
- 'class-methods-use-this': 'off',
94
- 'import/prefer-default-export': 'off',
95
- 'import/extensions': [
96
- 'error',
97
- 'never',
98
- {
99
- js: 'never',
100
- json: 'ignorePackages',
101
- },
102
- ],
103
- 'import/no-unresolved': ['error', {}],
104
- 'spaced-comment': ['error', 'always'],
105
- },
106
- },
107
- ]
5
+ export default [prettierRules, commonRules, unicornRules]
@@ -0,0 +1,63 @@
1
+ import eslint from '@eslint/js'
2
+
3
+ export default [
4
+ eslint.configs.recommended,
5
+ {
6
+ rules: {
7
+ 'no-console': 'warn',
8
+ 'no-debugger': 'warn',
9
+ 'object-curly-newline': 'off',
10
+ 'operator-linebreak': 'off',
11
+ 'function-paren-newline': 'off',
12
+ 'no-confusing-arrow': 'off',
13
+ 'newline-per-chained-call': 'off',
14
+ indent: 'off',
15
+ 'implicit-arrow-linebreak': 'off',
16
+ 'no-undef': 'off',
17
+ 'lines-between-class-members': [
18
+ 'error',
19
+ 'always',
20
+ {
21
+ exceptAfterSingleLine: true,
22
+ },
23
+ ],
24
+ 'prefer-template': 'error',
25
+ 'arrow-body-style': ['error', 'as-needed'],
26
+ 'no-return-assign': 'off',
27
+ 'newline-before-return': ['error'],
28
+ radix: 'off',
29
+ 'no-mixed-operators': 'off',
30
+ 'max-len': [
31
+ 'error',
32
+ {
33
+ code: 120,
34
+ tabWidth: 2,
35
+ ignoreComments: true,
36
+ ignoreRegExpLiterals: true,
37
+ ignoreStrings: true,
38
+ ignoreTrailingComments: true,
39
+ },
40
+ ],
41
+ camelcase: [
42
+ 'error',
43
+ {
44
+ allow: ['Open_Sans'],
45
+ },
46
+ ],
47
+ 'no-shadow': 'off',
48
+ 'no-unused-vars': 'off',
49
+ 'no-use-before-define': 'off',
50
+ 'sort-imports': [
51
+ 'error',
52
+ {
53
+ ignoreDeclarationSort: true,
54
+ },
55
+ ],
56
+ quotes: ['error', 'single'],
57
+ 'object-shorthand': 'error',
58
+ 'prefer-const': 'error',
59
+ 'class-methods-use-this': 'off',
60
+ 'spaced-comment': ['error', 'always'],
61
+ },
62
+ },
63
+ ]
@@ -0,0 +1,44 @@
1
+ import importPlugin from 'eslint-plugin-import'
2
+
3
+ export default [
4
+ {
5
+ plugins: { import: importPlugin },
6
+ rules: {
7
+ 'import/newline-after-import': 'error',
8
+ 'import/order': [
9
+ 'error',
10
+ {
11
+ 'newlines-between': 'always',
12
+ groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
13
+ pathGroups: [
14
+ {
15
+ pattern: '@/**',
16
+ group: 'external',
17
+ position: 'after',
18
+ },
19
+ ],
20
+ alphabetize: {
21
+ order: 'asc',
22
+ caseInsensitive: false,
23
+ },
24
+ },
25
+ ],
26
+ 'import/no-duplicates': [
27
+ 'error',
28
+ {
29
+ considerQueryString: true,
30
+ },
31
+ ],
32
+ 'import/prefer-default-export': 'off',
33
+ 'import/extensions': [
34
+ 'error',
35
+ 'never',
36
+ {
37
+ js: 'never',
38
+ json: 'ignorePackages',
39
+ },
40
+ ],
41
+ 'import/no-unresolved': ['error', {}],
42
+ },
43
+ },
44
+ ]
@@ -0,0 +1,10 @@
1
+ import prettierConfig from 'eslint-config-prettier'
2
+ import prettierPlugin from 'eslint-plugin-prettier'
3
+
4
+ export default [
5
+ prettierConfig,
6
+ {
7
+ plugins: { prettier: prettierPlugin },
8
+ rules: { 'prettier/prettier': 'error' },
9
+ },
10
+ ]
@@ -0,0 +1,3 @@
1
+ import sonarjs from 'eslint-plugin-sonarjs'
2
+
3
+ export default [sonarjs.configs.recommended, { plugins: { sonarjs } }]
@@ -0,0 +1,14 @@
1
+ import unicornPlugin from 'eslint-plugin-unicorn'
2
+
3
+ export default [
4
+ unicornPlugin.configs['flat/recommended'],
5
+ {
6
+ plugins: { unicorn: unicornPlugin },
7
+ rules: {
8
+ 'unicorn/consistent-destructuring': 'error',
9
+ 'unicorn/custom-error-definition': 'error',
10
+ 'unicorn/no-keyword-prefix': 'error',
11
+ 'unicorn/no-unused-properties': 'error',
12
+ },
13
+ },
14
+ ]
package/postinstall.js DELETED
@@ -1,9 +0,0 @@
1
- import gentlyCopy from 'gently-copy'
2
-
3
- const filesToCopy = ['./dist/eslint.config.js']
4
-
5
- // User's local directory
6
- const userPath = process.env.INIT_CWD
7
-
8
- // Moving files to user's local directory
9
- gentlyCopy(filesToCopy, userPath)