@codeleap/config 6.3.0 → 7.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.
Files changed (3) hide show
  1. package/eslint.config.js +135 -0
  2. package/package.json +13 -11
  3. package/.eslintrc.js +0 -210
@@ -0,0 +1,135 @@
1
+ const tsPlugin = require('@typescript-eslint/eslint-plugin')
2
+ const reactPlugin = require('eslint-plugin-react')
3
+ const reactHooksPlugin = require('eslint-plugin-react-hooks')
4
+ const globals = require('globals')
5
+ const unusedImports = require('eslint-plugin-unused-imports')
6
+ const codeleapPlugin = require('@codeleap/eslint-plugin')
7
+
8
+ const formatting = {
9
+ 'array-bracket-newline': 'off',
10
+ 'array-bracket-spacing': ['error', 'never'],
11
+ 'array-element-newline': ['error', 'consistent'],
12
+ 'arrow-parens': 'off',
13
+ 'arrow-spacing': ['error', { after: true, before: true }],
14
+ 'block-scoped-var': 'warn',
15
+ 'block-spacing': ['error', 'always'],
16
+ 'prefer-rest-params': 'off',
17
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
18
+ 'no-console': 'off',
19
+ 'react-hooks/exhaustive-deps': 'off',
20
+ camelcase: 'off',
21
+ 'comma-dangle': ['warn', 'always-multiline'],
22
+ 'comma-spacing': ['error', { after: true, before: false }],
23
+ 'comma-style': ['error', 'last'],
24
+ 'computed-property-spacing': ['error', 'never'],
25
+ 'consistent-this': 'error',
26
+ curly: ['error', 'multi-line'],
27
+ 'dot-location': ['warn', 'property'],
28
+ 'dot-notation': ['warn', { allowKeywords: true }],
29
+ quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
30
+ 'eol-last': 'error',
31
+ eqeqeq: 'off',
32
+ 'func-call-spacing': 'error',
33
+ 'func-name-matching': 'error',
34
+ 'func-names': ['error', 'never'],
35
+ 'implicit-arrow-linebreak': ['warn', 'beside'],
36
+ indent: ['error', 2, { SwitchCase: 1 }],
37
+ 'jsx-quotes': ['warn', 'prefer-single'],
38
+ 'key-spacing': 'error',
39
+ 'keyword-spacing': ['error', { after: true, before: true }],
40
+ 'linebreak-style': ['off'],
41
+ 'lines-between-class-members': ['error', 'always'],
42
+ 'max-len': 'off',
43
+ 'max-lines': ['warn', { max: 450, skipComments: true, skipBlankLines: true }],
44
+ 'max-lines-per-function': 'off',
45
+ 'new-parens': 'error',
46
+ 'newline-after-var': 'off',
47
+ 'newline-before-return': 'off',
48
+ 'newline-per-chained-call': ['warn', { ignoreChainWithDepth: 3 }],
49
+ 'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
50
+ 'no-multiple-empty-lines': ['warn', { max: 1, maxBOF: 0, maxEOF: 1 }],
51
+ semi: ['error', 'never'],
52
+ 'semi-spacing': 'error',
53
+ 'semi-style': 'error',
54
+ 'space-before-blocks': 'warn',
55
+ 'object-curly-spacing': ['warn', 'always', { objectsInObjects: false, arraysInObjects: true }],
56
+ 'no-trailing-spaces': 'warn',
57
+ 'no-whitespace-before-property': 'error',
58
+ 'space-before-function-paren': ['warn', { anonymous: 'always', named: 'never', asyncArrow: 'always' }],
59
+ 'space-in-parens': ['warn', 'never'],
60
+ 'space-infix-ops': 'warn',
61
+ 'no-spaced-func': 'error',
62
+ 'no-multi-spaces': 'warn',
63
+ }
64
+
65
+ const codeQuality = {
66
+ 'global-require': 'off',
67
+ 'handle-callback-err': 'warn',
68
+ 'callback-return': 'off',
69
+ }
70
+
71
+ const typescript = {
72
+ 'no-unused-vars': 'off',
73
+ 'unused-imports/no-unused-imports': 'error',
74
+ 'unused-imports/no-unused-vars': [
75
+ 'warn',
76
+ {
77
+ 'vars': 'all',
78
+ 'varsIgnorePattern': '^_',
79
+ 'args': 'after-used',
80
+ 'argsIgnorePattern': '^_',
81
+ },
82
+ ],
83
+ '@typescript-eslint/no-explicit-any': 'off',
84
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
85
+ '@typescript-eslint/ban-ts-comment': 'off',
86
+ '@typescript-eslint/no-empty-function': 'off',
87
+ '@typescript-eslint/no-var-requires': 'off',
88
+ '@typescript-eslint/no-unused-vars': 'off',
89
+ '@typescript-eslint/no-empty-interface': 'off',
90
+ '@typescript-eslint/no-empty-object-type': 'off',
91
+ }
92
+
93
+ module.exports = [
94
+ // Registers @typescript-eslint plugin, sets TS parser, enables recommended rules
95
+ ...tsPlugin.configs['flat/recommended'],
96
+ // Registers react-hooks plugin, enables recommended rules (exhaustive-deps overridden below)
97
+ reactHooksPlugin.configs.flat.recommended,
98
+ {
99
+ plugins: {
100
+ react: reactPlugin,
101
+ 'unused-imports': unusedImports,
102
+ codeleap: codeleapPlugin,
103
+ },
104
+ languageOptions: {
105
+ parserOptions: {
106
+ ecmaFeatures: { jsx: true },
107
+ ecmaVersion: 2018,
108
+ sourceType: 'module',
109
+ },
110
+ globals: {
111
+ ...globals.browser,
112
+ ...globals.node,
113
+ ...globals.es2015,
114
+ logger: 'readonly',
115
+ warn: 'readonly',
116
+ log: 'readonly',
117
+ deb: 'readonly',
118
+ error: 'readonly',
119
+ info: 'readonly',
120
+ fetch: 'readonly',
121
+ Tools: 'readonly',
122
+ __DEV__: 'readonly',
123
+ },
124
+ },
125
+ rules: {
126
+ ...formatting,
127
+ ...codeQuality,
128
+ ...typescript,
129
+ 'react-hooks/rules-of-hooks': 'off',
130
+ 'codeleap/rules-of-hooks': 'error',
131
+ 'codeleap/text-requires-color': 'error',
132
+ },
133
+ },
134
+ { ignores: ['node_modules/**', 'dist/**', 'out/**', '.next/**', 'public/**', '.github/**', 'config/scripts/**', 'eslint.config.js', 'src/styles/colors/**', 'config/locales/**', 'next-env.d.ts'] },
135
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/config",
3
- "version": "6.3.0",
3
+ "version": "7.0.0",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -9,19 +9,21 @@
9
9
  "directory": "packages/config"
10
10
  },
11
11
  "files": [
12
- ".eslintrc.js"
12
+ "eslint.config.js"
13
13
  ],
14
14
  "dependencies": {
15
- "@typescript-eslint/eslint-plugin": "^5.8.1",
16
- "@typescript-eslint/parser": "^5.8.1",
17
- "babel-eslint": "^10.1.0",
18
- "eslint-import-resolver-alias": "^1.1.2",
19
- "eslint-plugin-flowtype": "^8.0.3",
20
- "eslint-plugin-import": "^2.25.3",
21
- "eslint-plugin-react": "^7.28.0",
22
- "eslint-plugin-react-hooks": "^4.3.0"
15
+ "@codeleap/eslint-plugin": "7.0.0",
16
+ "@typescript-eslint/eslint-plugin": "8.60.0",
17
+ "@typescript-eslint/parser": "8.60.0",
18
+ "eslint-import-resolver-alias": "1.1.2",
19
+ "globals": "17.6.0",
20
+ "eslint-plugin-import": "2.32.0",
21
+ "eslint-plugin-react": "7.37.5",
22
+ "eslint-plugin-react-hooks": "7.1.1",
23
+ "eslint-plugin-unused-imports": "4.4.1",
24
+ "eslint": "10.4.0"
23
25
  },
24
26
  "scripts": {
25
27
  "build": "echo 'No build needed'"
26
28
  }
27
- }
29
+ }
package/.eslintrc.js DELETED
@@ -1,210 +0,0 @@
1
- const formatting = {
2
- 'array-bracket-newline': 'off',
3
- 'array-bracket-spacing': [
4
- 'error',
5
- 'never',
6
- ],
7
- 'array-element-newline': [
8
- 'error',
9
- 'consistent',
10
- ],
11
- 'arrow-parens': 'off',
12
- 'arrow-spacing': [
13
- 'error',
14
- {
15
- after: true,
16
- before: true,
17
- },
18
- ],
19
- 'block-scoped-var': 'warn',
20
- 'block-spacing': [
21
- 'error',
22
- 'always',
23
- ],
24
- 'prefer-rest-params': 'off',
25
- 'brace-style': [
26
- 'error',
27
- '1tbs',
28
- {
29
- allowSingleLine: true,
30
- },
31
- ],
32
- 'no-console': 'off',
33
- 'react-hooks/exhaustive-deps': 'off',
34
- 'callback-return': 'error',
35
- camelcase: 'off',
36
- 'comma-dangle': [
37
- 'warn',
38
- 'always-multiline',
39
- ],
40
- 'comma-spacing': [
41
- 'error',
42
- {
43
- after: true,
44
- before: false,
45
- },
46
- ],
47
- 'comma-style': [
48
- 'error',
49
- 'last',
50
- ],
51
- 'computed-property-spacing': [
52
- 'error',
53
- 'never',
54
- ],
55
- 'consistent-this': 'error',
56
- curly: ['error', 'multi-line'],
57
- 'dot-location': ['warn', 'property'],
58
- 'dot-notation': [
59
- 'warn',
60
- {
61
- allowKeywords: true,
62
- },
63
- ],
64
- quotes: ['warn', 'single', {
65
- avoidEscape: true,
66
- allowTemplateLiterals: true,
67
- }],
68
- 'eol-last': 'error',
69
- eqeqeq: 'off',
70
- 'func-call-spacing': 'error',
71
- 'func-name-matching': 'error',
72
- 'func-names': [
73
- 'error',
74
- 'never',
75
- ],
76
- 'implicit-arrow-linebreak': [
77
- 'warn',
78
- 'beside',
79
- ],
80
- indent: ['error', 2, {
81
- SwitchCase: 1,
82
- }],
83
- 'jsx-quotes': [
84
- 'warn',
85
- 'prefer-single',
86
- ],
87
- 'key-spacing': 'error',
88
- 'keyword-spacing': [
89
- 'error',
90
- {
91
- after: true,
92
- before: true,
93
- },
94
- ],
95
- 'linebreak-style': [
96
- 'off',
97
- ],
98
- 'lines-between-class-members': [
99
- 'error',
100
- 'always',
101
- ],
102
- 'max-len': ['warn', { code: 160, tabWidth: 3 }],
103
- 'max-lines': ['warn', {
104
- max: 450,
105
- skipComments: true,
106
- skipBlankLines: true,
107
- }],
108
- 'max-lines-per-function': 'off',
109
- 'new-parens': 'error',
110
- 'newline-after-var': 'off',
111
- 'newline-before-return': 'off',
112
- 'newline-per-chained-call': [
113
- 'warn',
114
- { ignoreChainWithDepth: 3 },
115
- ],
116
- 'func-style': [
117
- 'error',
118
- 'declaration',
119
- { allowArrowFunctions: true },
120
- ],
121
- 'no-multiple-empty-lines': ['warn', { max: 1, maxBOF: 0, maxEOF: 1 }],
122
- semi: ['error', 'never'],
123
- 'semi-spacing': 'error',
124
- 'semi-style': 'error',
125
- 'space-before-blocks': 'warn',
126
- 'object-curly-spacing': ['warn', 'always', { 'objectsInObjects': false, 'arraysInObjects': true }],
127
- 'no-trailing-spaces': 'warn',
128
- 'no-whitespace-before-property': 'error',
129
- // 'space-before-function-paren': ['error', 'never'],
130
- 'space-before-function-paren': ['warn', {
131
- 'anonymous': 'always',
132
- 'named': 'never',
133
- 'asyncArrow': 'always',
134
- }],
135
- 'space-in-parens': ['warn', 'never'],
136
- 'space-infix-ops': 'warn',
137
- 'no-spaced-func': 'error',
138
- 'no-multi-spaces': 'warn',
139
- }
140
-
141
- const codeQuality = {
142
- 'global-require': 'off',
143
- 'handle-callback-err': 'warn',
144
- 'callback-return': 'off',
145
- }
146
-
147
- const typescript = {
148
- 'no-unused-vars': 'off',
149
- '@typescript-eslint/no-unused-vars': ['warn', {
150
- 'ignoreRestSiblings': true,
151
- }],
152
- '@typescript-eslint/no-explicit-any': 'off',
153
- '@typescript-eslint/explicit-module-boundary-types': 'off',
154
- '@typescript-eslint/ban-ts-comment': 'off',
155
- '@typescript-eslint/ban-types': 'off',
156
- '@typescript-eslint/no-empty-function': 'off',
157
- '@typescript-eslint/semi': ['error', 'never'],
158
- '@typescript-eslint/member-delimiter-style': ['warn', {
159
- 'multiline': {
160
- 'delimiter': 'none',
161
- 'requireLast': true,
162
- },
163
- 'singleline': {
164
- 'delimiter': 'semi',
165
- 'requireLast': false,
166
- },
167
- 'multilineDetection': 'brackets',
168
- }],
169
- '@typescript-eslint/no-var-requires': 'off',
170
- }
171
-
172
- module.exports = {
173
- env: {
174
- es6: true,
175
- node: true,
176
- browser: true,
177
- },
178
- parserOptions: {
179
- ecmaFeatures: {
180
- jsx: true,
181
- },
182
- ecmaVersion: 2018,
183
- sourceType: 'module',
184
- },
185
- extends: [
186
- 'plugin:@typescript-eslint/recommended',
187
- ],
188
- parser: '@typescript-eslint/parser',
189
- plugins: [
190
- 'react',
191
- 'react-hooks',
192
- '@typescript-eslint',
193
- ],
194
- globals: {
195
- logger: true,
196
- warn: true,
197
- log: true,
198
- deb: true,
199
- error: true,
200
- info: true,
201
- fetch: true,
202
- Tools: true,
203
- __DEV__: true,
204
- },
205
- rules: {
206
- ...formatting,
207
- ...codeQuality,
208
- ...typescript,
209
- },
210
- }