@codeleap/config 1.1.0 → 2.3.15

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 (2) hide show
  1. package/.eslintrc.js +208 -182
  2. package/package.json +24 -19
package/.eslintrc.js CHANGED
@@ -1,182 +1,208 @@
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: 250,
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': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }],
122
- semi: ['error', 'never'],
123
- 'semi-spacing': 'error',
124
- 'semi-style': 'error',
125
- }
126
-
127
- const codeQuality = {
128
- 'global-require': 'off',
129
- 'handle-callback-err': 'warn',
130
- 'callback-return': 'off',
131
- }
132
-
133
- const typescript = {
134
- 'no-unused-vars': 'off',
135
- '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '_ig|jsx' }],
136
- '@typescript-eslint/no-explicit-any': 'off',
137
- '@typescript-eslint/explicit-module-boundary-types': 'off',
138
- '@typescript-eslint/ban-ts-comment': 'off',
139
- '@typescript-eslint/ban-types': 'off',
140
- '@typescript-eslint/no-empty-function': 'off',
141
-
142
- }
143
-
144
- module.exports = {
145
- env: {
146
- es6: true,
147
- node: true,
148
- browser: true,
149
- },
150
- parserOptions: {
151
- ecmaFeatures: {
152
- jsx: true,
153
- },
154
- ecmaVersion: 2018,
155
- sourceType: 'module',
156
- },
157
- extends: [
158
- 'plugin:@typescript-eslint/recommended',
159
- ],
160
- parser: '@typescript-eslint/parser',
161
- plugins: [
162
- 'react',
163
- 'react-hooks',
164
- '@typescript-eslint',
165
- ],
166
- globals: {
167
- logger: true,
168
- warn: true,
169
- log: true,
170
- deb: true,
171
- error: true,
172
- info: true,
173
- fetch: true,
174
- Tools: true,
175
- __DEV__: true,
176
- },
177
- rules: {
178
- ...formatting,
179
- ...codeQuality,
180
- ...typescript,
181
- },
182
- }
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: 250,
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', { varsIgnorePattern: '_ig|jsx' }],
150
+ '@typescript-eslint/no-explicit-any': 'off',
151
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
152
+ '@typescript-eslint/ban-ts-comment': 'off',
153
+ '@typescript-eslint/ban-types': 'off',
154
+ '@typescript-eslint/no-empty-function': 'off',
155
+ '@typescript-eslint/semi': ['error', 'never'],
156
+ '@typescript-eslint/member-delimiter-style': ['warn', {
157
+ 'multiline': {
158
+ 'delimiter': 'none',
159
+ 'requireLast': true,
160
+ },
161
+ 'singleline': {
162
+ 'delimiter': 'semi',
163
+ 'requireLast': false,
164
+ },
165
+ 'multilineDetection': 'brackets',
166
+ }],
167
+ '@typescript-eslint/no-var-require': 'off',
168
+ }
169
+
170
+ module.exports = {
171
+ env: {
172
+ es6: true,
173
+ node: true,
174
+ browser: true,
175
+ },
176
+ parserOptions: {
177
+ ecmaFeatures: {
178
+ jsx: true,
179
+ },
180
+ ecmaVersion: 2018,
181
+ sourceType: 'module',
182
+ },
183
+ extends: [
184
+ 'plugin:@typescript-eslint/recommended',
185
+ ],
186
+ parser: '@typescript-eslint/parser',
187
+ plugins: [
188
+ 'react',
189
+ 'react-hooks',
190
+ '@typescript-eslint',
191
+ ],
192
+ globals: {
193
+ logger: true,
194
+ warn: true,
195
+ log: true,
196
+ deb: true,
197
+ error: true,
198
+ info: true,
199
+ fetch: true,
200
+ Tools: true,
201
+ __DEV__: true,
202
+ },
203
+ rules: {
204
+ ...formatting,
205
+ ...codeQuality,
206
+ ...typescript,
207
+ },
208
+ }
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
- {
2
- "name": "@codeleap/config",
3
- "version": "1.1.0",
4
- "main": "index.js",
5
- "license": "MIT",
6
- "files": [
7
- ".eslintrc.js"
8
- ],
9
- "dependencies": {
10
- "@typescript-eslint/eslint-plugin": "^5.8.1",
11
- "@typescript-eslint/parser": "^5.8.1",
12
- "babel-eslint": "^10.1.0",
13
- "eslint-import-resolver-alias": "^1.1.2",
14
- "eslint-plugin-flowtype": "^8.0.3",
15
- "eslint-plugin-import": "^2.25.3",
16
- "eslint-plugin-react": "^7.28.0",
17
- "eslint-plugin-react-hooks": "^4.3.0"
18
- }
19
- }
1
+ {
2
+ "name": "@codeleap/config",
3
+ "version": "2.3.15",
4
+ "main": "index.js",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
8
+ "type": "git",
9
+ "directory": "packages/config"
10
+ },
11
+ "files": [
12
+ ".eslintrc.js"
13
+ ],
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"
23
+ }
24
+ }