eslint-config-dolmios 1.3.1 → 1.3.3

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/.prettierrc ADDED
@@ -0,0 +1 @@
1
+ "./configs/prettier/base.js"
package/LICENSE.md ADDED
@@ -0,0 +1 @@
1
+ It's an ESLINT config, go crazy.
package/README.md CHANGED
@@ -1,20 +1,14 @@
1
1
  # eslint-config-dolmios
2
2
 
3
- Linting setup.
3
+ > A simple ESLint setup using [@typescript-eslint](https://typescript-eslint.io), with Prettier and a couple TSConfig setup.
4
4
 
5
- ### Installation
6
-
7
- Ensure that you have `eslint`installed. Then install the package:
5
+ ## Install
8
6
 
9
7
  ```bash
10
-
8
+ npm install eslint-config-dolmios
11
9
  ```
12
10
 
13
- yarn add eslint-config-dolmios
14
-
15
- ````
16
-
17
- ### Usage
11
+ ## Usage
18
12
 
19
13
  Populate `.eslintrc` with the following, and code away.
20
14
 
@@ -22,13 +16,43 @@ Populate `.eslintrc` with the following, and code away.
22
16
  {
23
17
  "extends": ["dolmios"]
24
18
  }
25
- ````
19
+ ```
26
20
 
27
21
  ### Usage with Prettier
28
22
 
29
- Prettier is configured to work nicely with this config, though is an optional inclusion. If you'd like to include the config, you can add it
30
- to `package.json`.
23
+ Prettier is configured to work nicely with this config, though is an optional inclusion. If you'd like to include the config, you can add it to `package.json`.
24
+
25
+ ```json
26
+ "prettier": "eslint-config-dolmios/.prettierrc"
27
+ ```
28
+
29
+ #### Extending Prettier
30
+
31
+ > This method does **not** offer a way to _extend_ the configuration to overwrite some properties from the shared configuration. If you need to do that, import the file in a `.prettierrc.js` file and export the modifications.
32
+ > [https://prettier.io/docs/en/](https://prettier.io/docs/en/configuration.html#sharing-configurations)
33
+
34
+ ```js
35
+ module.exports = {
36
+ ...require("eslint-config-dolmios/configs/prettier/base.js"),
37
+ semi: false,
38
+ };
39
+ ```
40
+
41
+ ### Usage with TSConfig
42
+
43
+ This config also exports two TSConfig setups, `base` and `lib` respectively. The _base_ config is generally suitable. To include either, extend your `tsconfig.json`.
31
44
 
32
45
  ```json
33
- "prettier": "eslint-config-dolmios/.prettierrc.json"
46
+ "extends": "eslint-config-dolmios/configs/tsconfig/base.json"
47
+ // "extends": "eslint-config-dolmios/configs/tsconfig/lib" (req. further config for source and dist)
34
48
  ```
49
+
50
+ ## Contributing
51
+
52
+ Feel free to get in touch with feedback, advice or suggestions. See [Conventional Commits](https://gist.github.com/dolmios/0e33c579a500d87fc6f44df6cde97259) for new contributors.
53
+
54
+ ## Acknowledgments
55
+
56
+ - [eslint-plugin-sort-keys-fix](https://github.com/leo-buneev/eslint-plugin-sort-keys-fix)
57
+ - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import)
58
+ - [@tsconfig/next](https://www.npmjs.com/package/@tsconfig/next)
@@ -0,0 +1,251 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es6: true,
5
+ node: true,
6
+ },
7
+ extends: [
8
+ "plugin:@typescript-eslint/recommended",
9
+ "plugin:import/recommended",
10
+ "eslint:recommended",
11
+ ],
12
+ parser: "@typescript-eslint/parser",
13
+ plugins: ["sort-keys-fix", "@typescript-eslint"],
14
+ root: true,
15
+ rules: {
16
+ "@typescript-eslint/brace-style": "off",
17
+ "@typescript-eslint/comma-dangle": "off",
18
+ "@typescript-eslint/comma-spacing": "off",
19
+ "@typescript-eslint/explicit-function-return-type": "error",
20
+ "@typescript-eslint/func-call-spacing": "off",
21
+ "@typescript-eslint/indent": "off",
22
+ "@typescript-eslint/keyword-spacing": "off",
23
+ "@typescript-eslint/member-delimiter-style": "off",
24
+ "@typescript-eslint/no-explicit-any": "warn",
25
+ "@typescript-eslint/no-extra-parens": "off",
26
+ "@typescript-eslint/no-extra-semi": "off",
27
+ "@typescript-eslint/no-non-null-assertion": "error",
28
+ "@typescript-eslint/no-unused-vars": [
29
+ "error",
30
+ {
31
+ args: "none",
32
+ ignoreRestSiblings: true,
33
+ vars: "all",
34
+ },
35
+ ],
36
+ "@typescript-eslint/no-var-requires": "off",
37
+ "@typescript-eslint/object-curly-spacing": "off",
38
+ "@typescript-eslint/quotes": 0,
39
+ "@typescript-eslint/semi": "off",
40
+ "@typescript-eslint/space-before-blocks": "off",
41
+ "@typescript-eslint/space-before-function-paren": "off",
42
+ "@typescript-eslint/space-infix-ops": "off",
43
+ "@typescript-eslint/type-annotation-spacing": "off",
44
+ "array-bracket-newline": "off",
45
+ "array-bracket-spacing": "off",
46
+ "array-element-newline": "off",
47
+ "arrow-parens": "off",
48
+ "arrow-spacing": "off",
49
+ "block-spacing": "off",
50
+ "brace-style": "off",
51
+ camelcase: [
52
+ "error",
53
+ {
54
+ properties: "never",
55
+ },
56
+ ],
57
+ "comma-dangle": "off",
58
+ "comma-spacing": "off",
59
+ "comma-style": "off",
60
+ "computed-property-spacing": "off",
61
+ curly: 0,
62
+ "dot-location": "off",
63
+ "eol-last": "off",
64
+ "func-call-spacing": "off",
65
+ "func-names": ["error", "as-needed"],
66
+ "function-call-argument-newline": "off",
67
+ "function-paren-newline": "off",
68
+ "generator-star": "off",
69
+ "generator-star-spacing": "off",
70
+ "implicit-arrow-linebreak": "off",
71
+ "import/export": "error",
72
+ "import/first": "warn",
73
+ "import/named": "warn",
74
+ "import/namespace": "error",
75
+ "import/no-deprecated": "error",
76
+ "import/no-duplicates": "error",
77
+ "import/no-extraneous-dependencies": [
78
+ "error",
79
+ {
80
+ devDependencies: true,
81
+ },
82
+ ],
83
+ "import/no-named-as-default": "off",
84
+ "import/no-unresolved": "warn",
85
+ "import/order": [
86
+ "error",
87
+ {
88
+ alphabetize: {
89
+ caseInsensitive: true,
90
+ order: "asc",
91
+ },
92
+ groups: ["builtin", "external", "parent", "sibling", "index"],
93
+ "newlines-between": "always",
94
+ },
95
+ ],
96
+ indent: "off",
97
+ "jsx-quotes": "off",
98
+ "key-spacing": "off",
99
+ "keyword-spacing": "off",
100
+ "linebreak-style": "off",
101
+ "lines-around-comment": 0,
102
+ "max-len": 0,
103
+ "multiline-ternary": "off",
104
+ "new-parens": "off",
105
+ "newline-per-chained-call": "off",
106
+ "no-alert": "error",
107
+ "no-array-constructor": "error",
108
+ "no-arrow-condition": "off",
109
+ "no-comma-dangle": "off",
110
+ "no-confusing-arrow": 0,
111
+ "no-console": [
112
+ "warn",
113
+ {
114
+ allow: ["error", "warn"],
115
+ },
116
+ ],
117
+
118
+ "no-continue": "error",
119
+ "no-duplicate-imports": [
120
+ "error",
121
+ {
122
+ includeExports: true,
123
+ },
124
+ ],
125
+ "no-eq-null": "error",
126
+ "no-eval": "error",
127
+ "no-extend-native": "error",
128
+ "no-extra-bind": "error",
129
+ "no-extra-label": "error",
130
+ "no-extra-parens": "off",
131
+ "no-extra-semi": "off",
132
+ "no-floating-decimal": "off",
133
+ "no-invalid-this": "error",
134
+ "no-iterator": "error",
135
+ "no-label-var": "error",
136
+ "no-labels": [
137
+ "error",
138
+ {
139
+ allowLoop: false,
140
+ allowSwitch: false,
141
+ },
142
+ ],
143
+ "no-lone-blocks": "error",
144
+ "no-mixed-operators": [
145
+ "error",
146
+ {
147
+ allowSamePrecedence: false,
148
+ groups: [
149
+ ["&", "|", "^", "~", "<<", ">>", ">>>"],
150
+ ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
151
+ ["&&", "||"],
152
+ ["in", "instanceof"],
153
+ ],
154
+ },
155
+ ],
156
+ "no-mixed-spaces-and-tabs": "off",
157
+ "no-multi-spaces": "off",
158
+ "no-multi-str": "error",
159
+ "no-multiple-empty-lines": "off",
160
+ "no-new": "error",
161
+ "no-new-func": "error",
162
+ "no-new-object": "error",
163
+ "no-new-wrappers": "error",
164
+ "no-octal-escape": "error",
165
+ "no-proto": "error",
166
+ "no-reserved-keys": "off",
167
+ "no-space-before-semi": "off",
168
+ "no-tabs": 0,
169
+ "no-template-curly-in-string": "error",
170
+ "no-trailing-spaces": "off",
171
+ "no-undef": "off",
172
+ "no-unexpected-multiline": 0,
173
+ "no-unreachable-loop": "error",
174
+ "no-unused-expressions": [
175
+ "error",
176
+ {
177
+ allowShortCircuit: true,
178
+ allowTernary: true,
179
+ enforceForJSX: true,
180
+ },
181
+ ],
182
+ "no-use-before-define": [
183
+ "error",
184
+ {
185
+ classes: true,
186
+ functions: false,
187
+ },
188
+ ],
189
+ "no-useless-call": "error",
190
+ "no-useless-concat": "error",
191
+ "no-whitespace-before-property": "off",
192
+ "no-wrap-func": "off",
193
+ "nonblock-statement-body-position": "off",
194
+ "object-curly-newline": "off",
195
+ "object-curly-spacing": "off",
196
+ "object-property-newline": "off",
197
+ "one-var": [
198
+ "error",
199
+ {
200
+ initialized: "never",
201
+ },
202
+ ],
203
+ "one-var-declaration-per-line": "off",
204
+ "operator-linebreak": "off",
205
+ "padded-blocks": "off",
206
+ "quote-props": "off",
207
+ quotes: 0,
208
+ "rest-spread-spacing": "off",
209
+ semi: "off",
210
+ "semi-spacing": "off",
211
+ "semi-style": "off",
212
+ "sort-keys-fix/sort-keys-fix": "error",
213
+ "space-after-function-name": "off",
214
+ "space-after-keywords": "off",
215
+ "space-before-blocks": "off",
216
+ "space-before-function-paren": "off",
217
+ "space-before-function-parentheses": "off",
218
+ "space-before-keywords": "off",
219
+ "space-in-brackets": "off",
220
+ "space-in-parens": "off",
221
+ "space-infix-ops": "error",
222
+ "space-return-throw-case": "off",
223
+ "space-unary-ops": [
224
+ "error",
225
+ {
226
+ nonwords: false,
227
+ words: true,
228
+ },
229
+ ],
230
+ "space-unary-word-ops": "off",
231
+ "spaced-comment": [
232
+ "error",
233
+ "always",
234
+ {
235
+ line: {
236
+ exceptions: ["-"],
237
+ },
238
+ },
239
+ ],
240
+ "switch-colon-spacing": "off",
241
+ "template-curly-spacing": ["error", "never"],
242
+ "template-tag-spacing": "off",
243
+ "unicode-bom": "off",
244
+ "vue/html-self-closing": 0,
245
+ "vue/max-len": 0,
246
+ "wrap-iife": "off",
247
+ "wrap-regex": "off",
248
+ "yield-star-spacing": "off",
249
+ yoda: ["error", "never"],
250
+ },
251
+ };
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ printWidth: 80,
3
+ tabWidth: 2,
4
+ useTabs: false,
5
+ semi: true,
6
+ singleQuote: false,
7
+ quoteProps: "as-needed",
8
+ jsxSingleQuote: false,
9
+ trailingComma: "es5",
10
+ bracketSpacing: true,
11
+ bracketSameLine: false,
12
+ arrowParens: "always",
13
+ proseWrap: "preserve",
14
+ htmlWhitespaceSensitivity: "ignore",
15
+ endOfLine: "lf",
16
+ };
@@ -0,0 +1,18 @@
1
+ // T-3235 - don't use this swc config for now (if swcrc can even be extended?)
2
+ module.exports = {
3
+ $schema: "https://json.schemastore.org/swcrc",
4
+ jsc: {
5
+ parser: {
6
+ syntax: "typescript",
7
+ jsx: true,
8
+ tsx: true,
9
+ dynamicImport: true,
10
+ decorators: true,
11
+ },
12
+ target: "esnext",
13
+ },
14
+ minify: false,
15
+ module: {
16
+ type: "es6",
17
+ },
18
+ };
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "dolmios",
4
+ "compilerOptions": {
5
+ "target": "es6",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "noEmit": true,
12
+ "esModuleInterop": true,
13
+ "module": "esnext",
14
+ "moduleResolution": "node",
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "jsx": "preserve",
18
+ "incremental": true
19
+ }
20
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "dolmios",
4
+ "compilerOptions": {
5
+ "target": "es6",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "noEmit": true,
12
+ "esModuleInterop": true,
13
+ "module": "esnext",
14
+ "moduleResolution": "node",
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "jsx": "react-jsx",
18
+ "incremental": true,
19
+ "importHelpers": true,
20
+ "declaration": true,
21
+ "sourceMap": true,
22
+ "noImplicitReturns": true,
23
+ "noFallthroughCasesInSwitch": true,
24
+ "noImplicitAny": true,
25
+ "noImplicitThis": true,
26
+ "noUnusedLocals": true,
27
+ "noUnusedParameters": true,
28
+ "allowSyntheticDefaultImports": true,
29
+ "emitDecoratorMetadata": true
30
+ }
31
+ }
package/index.js CHANGED
@@ -1,215 +1 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- node: true,
6
- },
7
- extends: [
8
- 'plugin:@typescript-eslint/recommended',
9
- 'plugin:import/recommended',
10
- 'eslint:recommended',
11
- ],
12
- parser: '@typescript-eslint/parser',
13
- plugins: ['sort-keys-fix', '@typescript-eslint'],
14
- root: true,
15
- rules: {
16
- '@typescript-eslint/brace-style': 'off',
17
- '@typescript-eslint/comma-dangle': 'off',
18
- '@typescript-eslint/comma-spacing': 'off',
19
- '@typescript-eslint/explicit-function-return-type': 'error',
20
- '@typescript-eslint/func-call-spacing': 'off',
21
- '@typescript-eslint/indent': 'off',
22
- '@typescript-eslint/keyword-spacing': 'off',
23
- '@typescript-eslint/member-delimiter-style': 'off',
24
- '@typescript-eslint/no-explicit-any': 'warn',
25
- '@typescript-eslint/no-extra-parens': 'off',
26
- '@typescript-eslint/no-extra-semi': 'off',
27
- '@typescript-eslint/no-non-null-assertion': 'error',
28
- '@typescript-eslint/no-unused-vars': [
29
- 'error',
30
- {
31
- args: 'none',
32
- ignoreRestSiblings: true,
33
- vars: 'all',
34
- },
35
- ],
36
- '@typescript-eslint/no-var-requires': 'off',
37
- '@typescript-eslint/object-curly-spacing': 'off',
38
- '@typescript-eslint/quotes': 0,
39
- '@typescript-eslint/semi': 'off',
40
- '@typescript-eslint/space-before-blocks': 'off',
41
- '@typescript-eslint/space-before-function-paren': 'off',
42
- '@typescript-eslint/space-infix-ops': 'off',
43
- '@typescript-eslint/type-annotation-spacing': 'off',
44
- 'array-bracket-newline': 'off',
45
- 'array-bracket-spacing': 'off',
46
- 'array-element-newline': 'off',
47
- 'arrow-parens': 'off',
48
- 'arrow-spacing': 'off',
49
- 'block-spacing': 'off',
50
- 'brace-style': 'off',
51
- 'camelcase': ['error', { properties: 'never' }],
52
- 'comma-dangle': 'off',
53
- 'comma-spacing': 'off',
54
- 'comma-style': 'off',
55
- 'computed-property-spacing': 'off',
56
- 'curly': 0,
57
- 'dot-location': 'off',
58
- 'eol-last': 'off',
59
- 'func-call-spacing': 'off',
60
- 'func-names': ['error', 'as-needed'],
61
- 'function-call-argument-newline': 'off',
62
- 'function-paren-newline': 'off',
63
- 'generator-star': 'off',
64
- 'generator-star-spacing': 'off',
65
- 'implicit-arrow-linebreak': 'off',
66
- 'import/export': 'error',
67
- 'import/first': 'warn',
68
- 'import/named': 'warn',
69
- 'import/namespace': 'error',
70
- 'import/no-deprecated': 'error',
71
- 'import/no-duplicates': 'error',
72
- 'import/no-extraneous-dependencies': [
73
- 'error',
74
- {
75
- devDependencies: true,
76
- },
77
- ],
78
- 'import/no-named-as-default': 'off',
79
- 'import/no-unresolved': 'warn',
80
- 'import/order': [
81
- 'error',
82
- {
83
- 'alphabetize': {
84
- caseInsensitive: true,
85
- order: 'asc',
86
- },
87
- 'groups': ['builtin', 'external', 'parent', 'sibling', 'index'],
88
- 'newlines-between': 'always',
89
- },
90
- ],
91
- 'indent': 'off',
92
- 'jsx-quotes': 'off',
93
- 'key-spacing': 'off',
94
- 'keyword-spacing': 'off',
95
- 'linebreak-style': 'off',
96
- 'lines-around-comment': 0,
97
- 'max-len': 0,
98
- 'multiline-ternary': 'off',
99
- 'new-parens': 'off',
100
- 'newline-per-chained-call': 'off',
101
- 'no-alert': 'error',
102
- 'no-array-constructor': 'error',
103
- 'no-arrow-condition': 'off',
104
- 'no-comma-dangle': 'off',
105
- 'no-confusing-arrow': 0,
106
- 'no-console': [
107
- 'warn',
108
- {
109
- allow: ['error', 'warn'],
110
- },
111
- ],
112
-
113
- 'no-continue': 'error',
114
- 'no-duplicate-imports': ['error', { includeExports: true }],
115
- 'no-eq-null': 'error',
116
- 'no-eval': 'error',
117
- 'no-extend-native': 'error',
118
- 'no-extra-bind': 'error',
119
- 'no-extra-label': 'error',
120
- 'no-extra-parens': 'off',
121
- 'no-extra-semi': 'off',
122
- 'no-floating-decimal': 'off',
123
- 'no-invalid-this': 'error',
124
- 'no-iterator': 'error',
125
- 'no-label-var': 'error',
126
- 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
127
- 'no-lone-blocks': 'error',
128
- 'no-mixed-operators': [
129
- 'error',
130
- {
131
- allowSamePrecedence: false,
132
- groups: [
133
- ['&', '|', '^', '~', '<<', '>>', '>>>'],
134
- ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
135
- ['&&', '||'],
136
- ['in', 'instanceof'],
137
- ],
138
- },
139
- ],
140
- 'no-mixed-spaces-and-tabs': 'off',
141
- 'no-multi-spaces': 'off',
142
- 'no-multi-str': 'error',
143
- 'no-multiple-empty-lines': 'off',
144
- 'no-new': 'error',
145
- 'no-new-func': 'error',
146
- 'no-new-object': 'error',
147
- 'no-new-wrappers': 'error',
148
- 'no-octal-escape': 'error',
149
- 'no-proto': 'error',
150
- 'no-reserved-keys': 'off',
151
- 'no-space-before-semi': 'off',
152
- 'no-tabs': 0,
153
- 'no-template-curly-in-string': 'error',
154
- 'no-trailing-spaces': 'off',
155
- 'no-undef': 'off',
156
- 'no-unexpected-multiline': 0,
157
- 'no-unreachable-loop': 'error',
158
- 'no-unused-expressions': [
159
- 'error',
160
- {
161
- allowShortCircuit: true,
162
- allowTernary: true,
163
- enforceForJSX: true,
164
- },
165
- ],
166
- 'no-use-before-define': ['error', { classes: true, functions: false }],
167
- 'no-useless-call': 'error',
168
- 'no-useless-concat': 'error',
169
- 'no-whitespace-before-property': 'off',
170
- 'no-wrap-func': 'off',
171
- 'nonblock-statement-body-position': 'off',
172
- 'object-curly-newline': 'off',
173
- 'object-curly-spacing': 'off',
174
- 'object-property-newline': 'off',
175
- 'one-var': [
176
- 'error',
177
- {
178
- initialized: 'never',
179
- },
180
- ],
181
- 'one-var-declaration-per-line': 'off',
182
- 'operator-linebreak': 'off',
183
- 'padded-blocks': 'off',
184
- 'quote-props': 'off',
185
- 'quotes': 0,
186
- 'rest-spread-spacing': 'off',
187
- 'semi': 'off',
188
- 'semi-spacing': 'off',
189
- 'semi-style': 'off',
190
- 'sort-keys-fix/sort-keys-fix': 'error',
191
- 'space-after-function-name': 'off',
192
- 'space-after-keywords': 'off',
193
- 'space-before-blocks': 'off',
194
- 'space-before-function-paren': 'off',
195
- 'space-before-function-parentheses': 'off',
196
- 'space-before-keywords': 'off',
197
- 'space-in-brackets': 'off',
198
- 'space-in-parens': 'off',
199
- 'space-infix-ops': 'error',
200
- 'space-return-throw-case': 'off',
201
- 'space-unary-ops': ['error', { nonwords: false, words: true }],
202
- 'space-unary-word-ops': 'off',
203
- 'spaced-comment': ['error', 'always', { line: { exceptions: ['-'] } }],
204
- 'switch-colon-spacing': 'off',
205
- 'template-curly-spacing': ['error', 'never'],
206
- 'template-tag-spacing': 'off',
207
- 'unicode-bom': 'off',
208
- 'vue/html-self-closing': 0,
209
- 'vue/max-len': 0,
210
- 'wrap-iife': 'off',
211
- 'wrap-regex': 'off',
212
- 'yield-star-spacing': 'off',
213
- 'yoda': ['error', 'never'],
214
- },
215
- };
1
+ export * from "./configs/eslint/base";
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "eslint-config-dolmios",
3
- "description": "Linting setup.",
4
- "version": "1.3.1",
3
+ "description": " A simple ESLint setup using @typescript-eslint",
4
+ "version": "1.3.3",
5
5
  "author": "Jackson Dolman <mail@dolmios.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/dolmios/eslint-config-dolmios/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@typescript-eslint/eslint-plugin": "^5.45.0",
11
- "@typescript-eslint/parser": "^5.45.0",
12
- "eslint": "^8.28.0",
10
+ "@typescript-eslint/eslint-plugin": "^5.47.0",
11
+ "@typescript-eslint/parser": "^5.47.0",
12
+ "eslint": "^8.30.0",
13
13
  "eslint-plugin-import": "^2.26.0",
14
14
  "eslint-plugin-sort-keys-fix": "^1.1.2",
15
- "prettier": "^2.8.0",
16
- "typescript": "^4.9.3"
15
+ "prettier": "^2.8.1",
16
+ "typescript": "^4.9.4"
17
17
  },
18
18
  "homepage": "https://github.com/dolmios/eslint-config-dolmios#readme",
19
19
  "keywords": [
@@ -24,12 +24,12 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "main": "index.js",
27
- "packageManager": "yarn@3.3.0",
28
27
  "repository": {
29
28
  "type": "git",
30
29
  "url": "git+https://github.com/dolmios/eslint-config-dolmios.git"
31
30
  },
32
31
  "scripts": {
33
- "test": "eslint --ext .js"
32
+ "lint": "eslint --ext .js",
33
+ "prettier": "prettier --write ."
34
34
  }
35
- }
35
+ }
package/.pinyarn.js DELETED
@@ -1,144 +0,0 @@
1
- // To update this file use `yarn dlx pinyarn <yarn_version>` or `npx pinyarn <yarn_version>`
2
- const https = require('https');
3
- const fs = require('fs');
4
- const crypto = require('crypto');
5
- const path = require('path');
6
- const zlib = require('zlib');
7
- const { PassThrough } = require('stream');
8
-
9
- const config = {
10
- "ghTokens": [
11
- [
12
- "github_pat_",
13
- "11AAJTTFQ0REJCNOIAnP5j_f7uJsYJPDzc0vBxTK5HnKH6Vi0UpqPjvmMuK28AQKFDD5DV2J2E3Mim8CQ4"
14
- ]
15
- ],
16
- "yarnUrl": "https://raw.githubusercontent.com/yarnpkg/berry/%40yarnpkg/cli/4.0.0-rc.31/packages/yarnpkg-cli/bin/yarn.js"
17
- };
18
-
19
- const getUrlHash = url => crypto.createHash('sha256').update(url).digest('hex').substring(0, 8);
20
-
21
- const YARN_URL_HASH = getUrlHash(config.yarnUrl);
22
- let BERRY_HEADERS = {
23
- 'User-Agent': `pinyarn/?`
24
- };
25
- if (config.yarnUrl.includes('/artifacts/')) {
26
- BERRY_HEADERS['Authorization'] = `token ${config.ghTokens[Math.floor(Math.random() * config.ghTokens.length)].join('')}`;
27
- }
28
- const YARNRC_YML_PATH = path.join(__dirname, '.yarnrc.yml');
29
- const PLUGIN_LIST = !fs.existsSync(YARNRC_YML_PATH) ? [] : fs.readFileSync(YARNRC_YML_PATH, 'utf-8')
30
- .split('\n')
31
- .filter(line => line.includes('.yarn/plugins/@yarnpkg/plugin-'))
32
- .map(line => line.replace(/^.*\.yarn\/plugins\/@yarnpkg\/plugin-(.*?)(?:-[0-9a-f]{8})?\.cjs$/, '$1'));
33
- const YARN_DIR = path.join(__dirname, '.yarn');
34
- const RELEASES_DIR = path.join(YARN_DIR, 'releases');
35
- const PLUGIN_DIR = path.join(YARN_DIR, 'plugins');
36
- const YARN_BINARY = path.join(RELEASES_DIR, `yarn-${YARN_URL_HASH}.cjs`);
37
-
38
- let stats;
39
- try {
40
- stats = fs.statSync(RELEASES_DIR);
41
- } catch (e) {}
42
- const CURRENT_YARN_BINARYNAME = !stats ? null : fs.readdirSync(RELEASES_DIR)[0];
43
- const CURRENT_YARN_URL_HASH = !CURRENT_YARN_BINARYNAME ? null : path.basename(CURRENT_YARN_BINARYNAME).slice(0, -path.extname(CURRENT_YARN_BINARYNAME).length).replace('yarn-', '');
44
-
45
- const downloadFile = (filePath, url) => {
46
- const urlParts = new URL(url);
47
- return new Promise((resolve, reject) =>
48
- https.get({
49
- host: urlParts.host,
50
- path: urlParts.pathname + urlParts.search,
51
- headers: BERRY_HEADERS
52
- }, res => {
53
- if (res.statusCode === 301 || res.statusCode === 302) {
54
- downloadFile(filePath, res.headers.location).then(resolve, reject);
55
- } else if (res.statusCode !== 200) {
56
- throw new Error(`Error downloading ${url}, status: ${res.statusCode}`);
57
- } else {
58
- const isZip = res.headers["content-type"] === 'application/zip';
59
- if (isZip) {
60
- const bufs = []
61
- res
62
- .on('data', chunk => {
63
- bufs.push(chunk);
64
- })
65
- .on('error', err => {
66
- reject(err);
67
- })
68
- .on('end', () => {
69
- const buf = Buffer.concat(bufs);
70
- const name = 'yarnpkg-cli/bundles/yarn-min.js';
71
- const locOff = buf.indexOf(name);
72
- const off = buf.indexOf(name, locOff + 1);
73
- const dataSize = buf.readUInt32LE(off - 26);
74
- const dataStart = locOff + name.length;
75
- const data = buf.slice(dataStart, dataStart + dataSize);
76
- fs.writeFileSync(filePath, zlib.inflateRawSync(data));
77
- resolve();
78
- });
79
- } else {
80
- const file = fs.createWriteStream(filePath);
81
- res
82
- .on('data', chunk => {
83
- file.write(chunk);
84
- })
85
- .on('error', err => {
86
- reject(err);
87
- })
88
- .on('end', () => file.end());
89
- file
90
- .on('finish', resolve);
91
- }
92
- }
93
- }).on('error', reject)
94
- ).catch(err => {
95
- fs.unlinkSync(filePath);
96
- throw err;
97
- });
98
- }
99
-
100
- const promises = []
101
-
102
- if (CURRENT_YARN_URL_HASH !== YARN_URL_HASH) {
103
- if (CURRENT_YARN_BINARYNAME) {
104
- if (fs.existsSync(RELEASES_DIR))
105
- fs.rmdirSync(RELEASES_DIR, { recursive: true });
106
- if (fs.existsSync(PLUGIN_DIR))
107
- fs.rmdirSync(PLUGIN_DIR, { recursive: true });
108
- }
109
-
110
- if (!fs.existsSync(RELEASES_DIR))
111
- fs.mkdirSync(RELEASES_DIR, { recursive: true });
112
-
113
- promises.push(downloadFile(YARN_BINARY, config.yarnUrl));
114
- }
115
-
116
- for (const plugin of PLUGIN_LIST) {
117
- const pluginUrl = (config.pluginUrls || {})[plugin];
118
- if (pluginUrl) {
119
- const pluginPath = path.join(PLUGIN_DIR, '@yarnpkg', `plugin-${plugin}-${getUrlHash(pluginUrl)}.cjs`)
120
- if (!fs.existsSync(pluginPath)) {
121
- fs.mkdirSync(path.join(PLUGIN_DIR, '@yarnpkg'), { recursive: true });
122
- promises.push(downloadFile(pluginPath, pluginUrl));
123
- }
124
- }
125
- }
126
-
127
- if (PLUGIN_LIST.length === 0) {
128
- if (fs.existsSync(PLUGIN_DIR))
129
- fs.rmdirSync(PLUGIN_DIR, { recursive: true });
130
- } else {
131
- const entries = fs.readdirSync(path.join(PLUGIN_DIR, '@yarnpkg'));
132
- for (const entry of entries) {
133
- const [,plugin, pluginHash] = entry.match(/plugin-(.*?)(?:-)?([0-9a-f]{8})?\.cjs/);
134
- const pluginUrl = (config.pluginUrls || {})[plugin];
135
- if (pluginUrl && (!PLUGIN_LIST.includes(plugin) || getUrlHash(pluginUrl) !== pluginHash))
136
- fs.unlinkSync(path.join(PLUGIN_DIR, '@yarnpkg', entry));
137
- }
138
- }
139
-
140
- Promise.all(promises)
141
- .then(
142
- () => require(YARN_BINARY),
143
- console.error
144
- );
package/.prettierrc.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "printWidth": 88,
3
- "tabWidth": 2,
4
- "useTabs": false,
5
- "semi": true,
6
- "singleQuote": true,
7
- "quoteProps": "consistent",
8
- "jsxSingleQuote": true,
9
- "trailingComma": "es5",
10
- "bracketSpacing": true,
11
- "bracketSameLine": true,
12
- "arrowParens": "always",
13
- "proseWrap": "preserve",
14
- "htmlWhitespaceSensitivity": "ignore"
15
- }
package/.yarnrc.yml DELETED
@@ -1,3 +0,0 @@
1
- nodeLinker: node-modules
2
-
3
- yarnPath: .pinyarn.js