@vinicunca/eslint-config 1.2.7
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/.eslintrc.js +5 -0
- package/.github/workflows/release.yml +34 -0
- package/.node-version +1 -0
- package/LICENSE +21 -0
- package/base.eslint.js +326 -0
- package/index.js +8 -0
- package/package.json +43 -0
- package/pnpm-lock.yaml +2610 -0
- package/react.eslint.js +19 -0
- package/standard.eslint.js +317 -0
- package/stylelint.config.js +7 -0
- package/typescript.eslint.js +109 -0
- package/vue.eslint.js +37 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
with:
|
|
14
|
+
fetch-depth: 0
|
|
15
|
+
- name: Set node
|
|
16
|
+
uses: actions/setup-node@v3
|
|
17
|
+
with:
|
|
18
|
+
node-version: 16.x
|
|
19
|
+
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
|
|
21
|
+
- name: Setup
|
|
22
|
+
run: npm i -g pnpm
|
|
23
|
+
|
|
24
|
+
- run: pnpm dlx conventional-github-releaser -p angular
|
|
25
|
+
env:
|
|
26
|
+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
|
|
28
|
+
- name: Install Dependencies
|
|
29
|
+
run: pnpm install
|
|
30
|
+
|
|
31
|
+
- name: Publish to NPM
|
|
32
|
+
run: pnpm publish --access public --no-git-checks
|
|
33
|
+
env:
|
|
34
|
+
NODE_AUTH_TOKEN: ${{ secrets.VINICUNCA_NPM_TOKEN }}
|
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
16.14.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-PRESENT praburangki<https://github.com/praburangki>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/base.eslint.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
const { defineConfig } = require('eslint-define-config');
|
|
2
|
+
|
|
3
|
+
module.exports = defineConfig({
|
|
4
|
+
root: true,
|
|
5
|
+
|
|
6
|
+
env: {
|
|
7
|
+
es6: true,
|
|
8
|
+
browser: true,
|
|
9
|
+
node: true,
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
extends: [
|
|
13
|
+
'./standard.eslint',
|
|
14
|
+
'plugin:import/recommended',
|
|
15
|
+
'plugin:eslint-comments/recommended',
|
|
16
|
+
'plugin:sonarjs/recommended',
|
|
17
|
+
'plugin:jsonc/recommended-with-jsonc',
|
|
18
|
+
'plugin:yml/standard',
|
|
19
|
+
'plugin:markdown/recommended',
|
|
20
|
+
],
|
|
21
|
+
|
|
22
|
+
ignorePatterns: [
|
|
23
|
+
'*.min.*',
|
|
24
|
+
'CHANGELOG.md',
|
|
25
|
+
'dist',
|
|
26
|
+
'LICENSE*',
|
|
27
|
+
'output',
|
|
28
|
+
'coverage',
|
|
29
|
+
'public',
|
|
30
|
+
'temp',
|
|
31
|
+
'packages-lock.json',
|
|
32
|
+
'pnpm-lock.yaml',
|
|
33
|
+
'yarn.lock',
|
|
34
|
+
'__snapshots__',
|
|
35
|
+
'!.github',
|
|
36
|
+
'!.vitepress',
|
|
37
|
+
'!.vscode',
|
|
38
|
+
],
|
|
39
|
+
|
|
40
|
+
plugins: [
|
|
41
|
+
'html', 'unicorn', 'sonarjs',
|
|
42
|
+
],
|
|
43
|
+
|
|
44
|
+
settings: {
|
|
45
|
+
'import/resolver': {
|
|
46
|
+
node: {
|
|
47
|
+
extensions: [
|
|
48
|
+
'.js', '.mjs', '.ts', '.d.ts',
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
rules: {
|
|
55
|
+
'import/order': ['error'],
|
|
56
|
+
'import/first': 'error',
|
|
57
|
+
'import/no-mutable-exports': 'error',
|
|
58
|
+
'import/no-unresolved': 'off',
|
|
59
|
+
'import/no-absolute-path': 'off',
|
|
60
|
+
|
|
61
|
+
// Common
|
|
62
|
+
'semi': ['error', 'always'],
|
|
63
|
+
'curly': ['error', 'all'],
|
|
64
|
+
'quotes': ['error', 'single'],
|
|
65
|
+
'quote-props': ['error', 'consistent-as-needed'],
|
|
66
|
+
'no-unused-vars': 'off',
|
|
67
|
+
'no-param-reassign': 'off',
|
|
68
|
+
'array-bracket-newline': ['error', 'consistent'],
|
|
69
|
+
'array-element-newline': ['error', 'consistent'],
|
|
70
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
71
|
+
'brace-style': ['error'],
|
|
72
|
+
'block-spacing': ['error', 'always'],
|
|
73
|
+
'camelcase': 'off',
|
|
74
|
+
'comma-spacing': ['error', { before: false, after: true }],
|
|
75
|
+
'comma-style': ['error', 'last'],
|
|
76
|
+
'comma-dangle': ['error', 'always-multiline'],
|
|
77
|
+
'no-constant-condition': 'warn',
|
|
78
|
+
'no-debugger': 'error',
|
|
79
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
80
|
+
'no-cond-assign': ['error', 'always'],
|
|
81
|
+
'no-tabs': 'error',
|
|
82
|
+
'func-call-spacing': ['off', 'never'],
|
|
83
|
+
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
84
|
+
'indent': [
|
|
85
|
+
'error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 },
|
|
86
|
+
],
|
|
87
|
+
'no-restricted-syntax': [
|
|
88
|
+
'error',
|
|
89
|
+
'DebuggerStatement',
|
|
90
|
+
'ForInStatement',
|
|
91
|
+
'LabeledStatement',
|
|
92
|
+
'WithStatement',
|
|
93
|
+
],
|
|
94
|
+
'object-curly-spacing': ['error', 'always'],
|
|
95
|
+
'no-return-await': 'off',
|
|
96
|
+
'space-before-function-paren': [
|
|
97
|
+
'error', {
|
|
98
|
+
anonymous: 'never',
|
|
99
|
+
named: 'never',
|
|
100
|
+
asyncArrow: 'always',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
|
|
104
|
+
// es6
|
|
105
|
+
'no-var': 'error',
|
|
106
|
+
'prefer-const': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
destructuring: 'any',
|
|
110
|
+
ignoreReadBeforeAssign: true,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
'prefer-arrow-callback': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
allowNamedFunctions: false,
|
|
117
|
+
allowUnboundThis: true,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
'object-shorthand': [
|
|
121
|
+
'error',
|
|
122
|
+
'always',
|
|
123
|
+
{
|
|
124
|
+
ignoreConstructors: false,
|
|
125
|
+
avoidQuotes: true,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
'prefer-rest-params': 'error',
|
|
129
|
+
'prefer-spread': 'error',
|
|
130
|
+
'prefer-template': 'error',
|
|
131
|
+
'template-curly-spacing': 'error',
|
|
132
|
+
'arrow-parens': ['error', 'always'],
|
|
133
|
+
'generator-star-spacing': 'off',
|
|
134
|
+
'spaced-comment': [
|
|
135
|
+
'error',
|
|
136
|
+
'always',
|
|
137
|
+
{
|
|
138
|
+
line: {
|
|
139
|
+
markers: ['/'],
|
|
140
|
+
exceptions: ['/', '#'],
|
|
141
|
+
},
|
|
142
|
+
block: {
|
|
143
|
+
markers: ['!'],
|
|
144
|
+
exceptions: ['*'],
|
|
145
|
+
balanced: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
|
|
150
|
+
// best-practice
|
|
151
|
+
'array-callback-return': 'error',
|
|
152
|
+
'block-scoped-var': 'error',
|
|
153
|
+
'consistent-return': 'off',
|
|
154
|
+
'complexity': ['off', 11],
|
|
155
|
+
'eqeqeq': ['error', 'smart'],
|
|
156
|
+
'no-alert': 'warn',
|
|
157
|
+
'no-case-declarations': 'error',
|
|
158
|
+
'no-multi-spaces': 'error',
|
|
159
|
+
'no-multi-str': 'error',
|
|
160
|
+
'no-with': 'error',
|
|
161
|
+
'no-void': 'error',
|
|
162
|
+
'no-useless-escape': 'off',
|
|
163
|
+
'vars-on-top': 'error',
|
|
164
|
+
'require-await': 'off',
|
|
165
|
+
'no-return-assign': 'off',
|
|
166
|
+
'operator-linebreak': ['error', 'before'],
|
|
167
|
+
|
|
168
|
+
// unicorns
|
|
169
|
+
// Pass error message when throwing errors
|
|
170
|
+
'unicorn/error-message': 'error',
|
|
171
|
+
// Uppercase regex escapes
|
|
172
|
+
'unicorn/escape-case': 'error',
|
|
173
|
+
// Array.isArray instead of instanceof
|
|
174
|
+
'unicorn/no-array-instanceof': 'error',
|
|
175
|
+
// Prevent deprecated `new Buffer()`
|
|
176
|
+
'unicorn/no-new-buffer': 'error',
|
|
177
|
+
// Keep regex literals safe!
|
|
178
|
+
'unicorn/no-unsafe-regex': 'off',
|
|
179
|
+
// Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
|
|
180
|
+
'unicorn/number-literal-case': 'error',
|
|
181
|
+
// ** instead of Math.pow()
|
|
182
|
+
'unicorn/prefer-exponentiation-operator': 'error',
|
|
183
|
+
// includes over indexOf when checking for existence
|
|
184
|
+
'unicorn/prefer-includes': 'error',
|
|
185
|
+
// String methods startsWith/endsWith instead of more complicated stuff
|
|
186
|
+
'unicorn/prefer-starts-ends-with': 'error',
|
|
187
|
+
// textContent instead of innerText
|
|
188
|
+
'unicorn/prefer-text-content': 'error',
|
|
189
|
+
// Enforce throwing type error when throwing error while checking typeof
|
|
190
|
+
'unicorn/prefer-type-error': 'error',
|
|
191
|
+
// Use new when throwing error
|
|
192
|
+
'unicorn/throw-new-error': 'error',
|
|
193
|
+
|
|
194
|
+
'no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
|
|
195
|
+
'eslint-comments/disable-enable-pair': 'off',
|
|
196
|
+
'import/no-named-as-default-member': 'off',
|
|
197
|
+
'n/no-callback-literal': 'off',
|
|
198
|
+
|
|
199
|
+
'sort-imports': [
|
|
200
|
+
'error',
|
|
201
|
+
{
|
|
202
|
+
ignoreCase: false,
|
|
203
|
+
ignoreDeclarationSort: true,
|
|
204
|
+
ignoreMemberSort: false,
|
|
205
|
+
memberSyntaxSortOrder: [
|
|
206
|
+
'none', 'all', 'multiple', 'single',
|
|
207
|
+
],
|
|
208
|
+
allowSeparatedGroups: false,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
|
|
212
|
+
// yml
|
|
213
|
+
'yml/quotes': ['error', { prefer: 'single', avoidEscape: false }],
|
|
214
|
+
'yml/no-empty-document': 'off',
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
overrides: [
|
|
218
|
+
{
|
|
219
|
+
files: ['*.json', '*.json5'],
|
|
220
|
+
parser: 'jsonc-eslint-parser',
|
|
221
|
+
rules: {
|
|
222
|
+
'quotes': ['error', 'double'],
|
|
223
|
+
'quote-props': ['error', 'always'],
|
|
224
|
+
'comma-dangle': ['error', 'never'],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
files: ['*.yaml', '*.yml'],
|
|
229
|
+
parser: 'yaml-eslint-parser',
|
|
230
|
+
rules: {
|
|
231
|
+
'spaced-comment': 'off',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
files: ['package.json'],
|
|
236
|
+
parser: 'jsonc-eslint-parser',
|
|
237
|
+
rules: {
|
|
238
|
+
'jsonc/sort-keys': [
|
|
239
|
+
'error',
|
|
240
|
+
{
|
|
241
|
+
pathPattern: '^$',
|
|
242
|
+
order: [
|
|
243
|
+
'name',
|
|
244
|
+
'type',
|
|
245
|
+
'version',
|
|
246
|
+
'private',
|
|
247
|
+
'packageManager',
|
|
248
|
+
'description',
|
|
249
|
+
'keywords',
|
|
250
|
+
'license',
|
|
251
|
+
'author',
|
|
252
|
+
'repository',
|
|
253
|
+
'funding',
|
|
254
|
+
'main',
|
|
255
|
+
'module',
|
|
256
|
+
'types',
|
|
257
|
+
'unpkg',
|
|
258
|
+
'jsdelivr',
|
|
259
|
+
'exports',
|
|
260
|
+
'files',
|
|
261
|
+
'bin',
|
|
262
|
+
'sideEffects',
|
|
263
|
+
'scripts',
|
|
264
|
+
'peerDependencies',
|
|
265
|
+
'peerDependenciesMeta',
|
|
266
|
+
'dependencies',
|
|
267
|
+
'optionalDependencies',
|
|
268
|
+
'devDependencies',
|
|
269
|
+
'husky',
|
|
270
|
+
'lint-staged',
|
|
271
|
+
'eslintConfig',
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
|
|
276
|
+
order: { type: 'asc' },
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
files: ['*.d.ts'],
|
|
283
|
+
rules: {
|
|
284
|
+
'import/no-duplicates': 'off',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
files: ['*.js'],
|
|
289
|
+
rules: {
|
|
290
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
files: ['scripts/**/*.*', 'cli.*'],
|
|
295
|
+
rules: {
|
|
296
|
+
'no-console': 'off',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
files: [
|
|
301
|
+
'*.test.ts', '*.test.js', '*.spec.ts', '*.spec.js',
|
|
302
|
+
],
|
|
303
|
+
rules: {
|
|
304
|
+
'no-unused-expressions': 'off',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
// Code blocks in markdown file
|
|
309
|
+
files: ['**/*.md/*.*'],
|
|
310
|
+
rules: {
|
|
311
|
+
'@typescript-eslint/no-redeclare': 'off',
|
|
312
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
313
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
314
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
315
|
+
'@typescript-eslint/comma-dangle': 'off',
|
|
316
|
+
'import/no-unresolved': 'off',
|
|
317
|
+
'no-alert': 'off',
|
|
318
|
+
'no-console': 'off',
|
|
319
|
+
'no-restricted-imports': 'off',
|
|
320
|
+
'no-undef': 'off',
|
|
321
|
+
'no-unused-expressions': 'off',
|
|
322
|
+
'no-unused-vars': 'off',
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
});
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vinicunca/eslint-config",
|
|
3
|
+
"version": "1.2.7",
|
|
4
|
+
"description": "Shareable configurations for ESLint & Stylelint",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "praburangki<https://github.com/praburangki>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/vinicunca/eslint-config.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
16
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
17
|
+
"eslint-define-config": "^1.3.0",
|
|
18
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
19
|
+
"eslint-plugin-html": "^6.2.0",
|
|
20
|
+
"eslint-plugin-import": "^2.26.0",
|
|
21
|
+
"eslint-plugin-jsonc": "^2.2.1",
|
|
22
|
+
"eslint-plugin-markdown": "^2.2.1",
|
|
23
|
+
"eslint-plugin-n": "^15.1.0",
|
|
24
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
25
|
+
"eslint-plugin-react": "^7.29.4",
|
|
26
|
+
"eslint-plugin-sonarjs": "^0.13.0",
|
|
27
|
+
"eslint-plugin-unicorn": "^42.0.0",
|
|
28
|
+
"eslint-plugin-vue": "^8.6.0",
|
|
29
|
+
"eslint-plugin-yml": "^0.14.0",
|
|
30
|
+
"jsonc-eslint-parser": "^2.1.0",
|
|
31
|
+
"stylelint": "^14.7.1",
|
|
32
|
+
"stylelint-config-standard": "^25.0.0",
|
|
33
|
+
"typescript": "^4.6.3",
|
|
34
|
+
"yaml-eslint-parser": "^0.5.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"bumpp": "^7.1.1",
|
|
38
|
+
"eslint": "^8.13.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"release": "bumpp package.json --commit --push --tag --commit 'chore: release v'"
|
|
42
|
+
}
|
|
43
|
+
}
|