Skip to content

Commit 6f7c60d

Browse files
committed
chore!: Update to ESLint 8
1 parent 8cf0aee commit 6f7c60d

16 files changed

+320
-321
lines changed

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
browser: true,
6+
},
7+
extends: [
8+
'eslint:recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
11+
'plugin:unicorn/recommended',
12+
'plugin:import/warnings',
13+
'plugin:regexp/recommended',
14+
'plugin:etc/recommended',
15+
'plugin:promise/recommended',
16+
'plugin:prettier/recommended',
17+
'prettier',
18+
],
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaVersion: 2022,
22+
project: 'tsconfig.json',
23+
sourceType: 'module',
24+
ecmaFeatures: {
25+
jsx: false,
26+
},
27+
warnOnUnsupportedTypeScriptVersion: false,
28+
},
29+
plugins: [
30+
'unicorn',
31+
'import',
32+
'wix-editor',
33+
'@typescript-eslint',
34+
'prettier',
35+
'simple-import-sort',
36+
'etc',
37+
'promise',
38+
'only-warn',
39+
],
40+
ignorePatterns: ['@generated/**', '*.config.js', '.*rc.js'],
41+
rules: {
42+
// core
43+
'consistent-return': [1, { treatUndefinedAsUnspecified: true }],
44+
quotes: [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }],
45+
semi: [1, 'always'],
46+
'max-lines': [1, { max: 300 }],
47+
'max-params': [1, { max: 5 }],
48+
'no-unneeded-ternary': [1],
49+
// wix-editor
50+
'wix-editor/no-instanceof-array': 1,
51+
'wix-editor/no-not-not': 1,
52+
'wix-editor/no-unneeded-match': 1,
53+
'wix-editor/prefer-filter': 1,
54+
'wix-editor/prefer-ternary': 1,
55+
'wix-editor/return-boolean': 1,
56+
'wix-editor/simplify-boolean-expression': 1,
57+
// unicorn
58+
'unicorn/prefer-spread': 0,
59+
'unicorn/catch-error-name': 0,
60+
'unicorn/prefer-node-protocol': 0,
61+
'unicorn/prevent-abbreviations': [
62+
1,
63+
{
64+
replacements: {
65+
args: false,
66+
err: false,
67+
prod: false,
68+
ref: false,
69+
params: false,
70+
},
71+
},
72+
],
73+
// import
74+
'import/max-dependencies': [1, { max: 15 }],
75+
// simple-import-sort with recomended settings
76+
'simple-import-sort/imports': 1,
77+
'simple-import-sort/exports': 1,
78+
'sort-imports': 0,
79+
'import/first': 1,
80+
'import/newline-after-import': 1,
81+
'import/no-duplicates': 1,
82+
// typescript-eslint
83+
'@typescript-eslint/no-floating-promises': 1,
84+
'@typescript-eslint/no-unnecessary-condition': 1,
85+
'@typescript-eslint/no-explicit-any': [1, { ignoreRestArgs: true }],
86+
},
87+
overrides: [
88+
{
89+
files: ['*.spec.ts', '**/testing/**/*.ts'],
90+
rules: {
91+
'unicorn/prefer-module': 0,
92+
'@typescript-eslint/no-unsafe-call': 0,
93+
'consistent-return': 0,
94+
'max-lines': 0,
95+
'@typescript-eslint/no-explicit-any': 0,
96+
'@typescript-eslint/no-floating-promises': 0,
97+
'@typescript-eslint/no-non-null-assertion': 0,
98+
'@typescript-eslint/camelcase': 0,
99+
'import/max-dependencies': 0,
100+
},
101+
},
102+
],
103+
};

.eslintrc.js

Lines changed: 0 additions & 78 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/.idea
33
/.awcache
44
/.vscode
5-
/.nyc_output
65
*.log
76
~*
87
/dist/
98
/dist_*
9+
/coverage/

.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
package-lock = false
2-
# save-exact = true
2+
loglevel = error

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# eslint-plugin-no-eslint-disable
2+
23
Disallow disable rules by `eslint-disable` comment.
34

4-
## RULE ID
5-
`no-eslint-disable/no-eslint-disable`
5+
## Rules
6+
7+
`no-eslint-disable/no-eslint-disable`
8+
9+
## License
610

7-
## CHANGELOG
8-
See [CHANGELOG.md](CHANGELOG.md)
11+
[MIT License](https://opensource.org/licenses/MIT) (c) 2022

Taskfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
PATH="$PWD/node_modules/.bin":$PATH
3+
set -e
4+
5+
build_pkgroll() {
6+
set -x
7+
rm -rf dist
8+
mkdir dist
9+
# https://esbuild.github.io/api/#target
10+
npx pkgroll --target=es2020
11+
cp -f README.md dist
12+
cat package.json | jq '.main = "./index.cjs"' |
13+
jq '.module = "./index.mjs"' |
14+
jq '.types = "./index.d.ts"' |
15+
jq '.exports.".".import = "./index.mjs"' |
16+
jq '.exports.".".require = "./index.cjs"' \
17+
>dist/package.json
18+
set +x
19+
}
20+
21+
"$@"

0 commit comments

Comments
 (0)