@codeleap/config 1.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 (2) hide show
  1. package/.eslintrc.js +178 -0
  2. package/package.json +19 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,178 @@
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
+ 'brace-style': [
25
+ 'error',
26
+ '1tbs',
27
+ {
28
+ allowSingleLine: true,
29
+ },
30
+ ],
31
+ 'no-console': 'off',
32
+ 'react-hooks/exhaustive-deps': 'off',
33
+ 'callback-return': 'error',
34
+ camelcase: 'off',
35
+ 'comma-dangle': [
36
+ 'warn',
37
+ 'always-multiline',
38
+ ],
39
+ 'comma-spacing': [
40
+ 'error',
41
+ {
42
+ after: true,
43
+ before: false,
44
+ },
45
+ ],
46
+ 'comma-style': [
47
+ 'error',
48
+ 'last',
49
+ ],
50
+ 'computed-property-spacing': [
51
+ 'error',
52
+ 'never',
53
+ ],
54
+ 'consistent-this': 'error',
55
+ curly: ['error', 'multi-line'],
56
+ 'dot-location': ['warn', 'property'],
57
+ 'dot-notation': [
58
+ 'warn',
59
+ {
60
+ allowKeywords: true,
61
+ },
62
+ ],
63
+ quotes: ['warn', 'single', {
64
+ avoidEscape: true,
65
+ allowTemplateLiterals: true,
66
+ }],
67
+ 'eol-last': 'error',
68
+ eqeqeq: 'off',
69
+ 'func-call-spacing': 'error',
70
+ 'func-name-matching': 'error',
71
+ 'func-names': [
72
+ 'error',
73
+ 'never',
74
+ ],
75
+ 'implicit-arrow-linebreak': [
76
+ 'warn',
77
+ 'beside',
78
+ ],
79
+ indent: ['error', 2, {
80
+ SwitchCase: 1,
81
+ }],
82
+ 'jsx-quotes': [
83
+ 'warn',
84
+ 'prefer-single',
85
+ ],
86
+ 'key-spacing': 'error',
87
+ 'keyword-spacing': [
88
+ 'error',
89
+ {
90
+ after: true,
91
+ before: true,
92
+ },
93
+ ],
94
+ 'linebreak-style': [
95
+ 'off',
96
+ ],
97
+ 'lines-between-class-members': [
98
+ 'error',
99
+ 'always',
100
+ ],
101
+ 'max-len': ['warn', { code: 160, tabWidth: 3 }],
102
+ 'max-lines': ['warn', {
103
+ max: 250,
104
+ skipComments: true,
105
+ skipBlankLines: true,
106
+ }],
107
+ 'max-lines-per-function': 'off',
108
+ 'new-parens': 'error',
109
+ 'newline-after-var': 'off',
110
+ 'newline-before-return': 'off',
111
+ 'newline-per-chained-call': [
112
+ 'warn',
113
+ { ignoreChainWithDepth: 3 },
114
+ ],
115
+ 'func-style': [
116
+ 'error',
117
+ 'declaration',
118
+ { allowArrowFunctions: true },
119
+ ],
120
+ }
121
+
122
+ const codeQuality = {
123
+
124
+ 'global-require': 'off',
125
+ 'handle-callback-err': 'warn',
126
+ 'callback-return': 'off',
127
+ }
128
+
129
+ const typescript = {
130
+ 'no-unused-vars': 'off',
131
+ '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '_ig|jsx' }],
132
+ '@typescript-eslint/no-explicit-any': 'off',
133
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
134
+ '@typescript-eslint/ban-ts-comment': 'off',
135
+ '@typescript-eslint/ban-types': 'off',
136
+ '@typescript-eslint/no-empty-function': 'off',
137
+
138
+ }
139
+
140
+ module.exports = {
141
+ env: {
142
+ es6: true,
143
+ node: true,
144
+ browser: true,
145
+ },
146
+ parserOptions: {
147
+ ecmaFeatures: {
148
+ jsx: true,
149
+ },
150
+ ecmaVersion: 2018,
151
+ sourceType: 'module',
152
+ },
153
+ extends: [
154
+ 'plugin:@typescript-eslint/recommended',
155
+ ],
156
+ parser: '@typescript-eslint/parser',
157
+ plugins: [
158
+ 'react',
159
+ 'react-hooks',
160
+ '@typescript-eslint',
161
+ ],
162
+ globals: {
163
+ warn: true,
164
+ log: true,
165
+ deb: true,
166
+ error: true,
167
+ info: true,
168
+ fetch: true,
169
+ Tools: true,
170
+ __DEV__: true,
171
+ },
172
+ rules: {
173
+ ...formatting,
174
+ ...codeQuality,
175
+ ...typescript,
176
+ },
177
+ }
178
+
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@codeleap/config",
3
+ "version": "1.0.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
+ }