Skip to content

Commit c4005ce

Browse files
committed
feat: switch to yarn, upgrade all dependencies
BREAKING CHANGE: major version upgrades to several plugins
1 parent fa4a2cb commit c4005ce

File tree

6 files changed

+2676
-1650
lines changed

6 files changed

+2676
-1650
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
node_modules
1+
node_modules
2+
.pnp.*
3+
.yarn/*
4+
!.yarn/patches
5+
!.yarn/plugins
6+
!.yarn/releases
7+
!.yarn/sdks
8+
!.yarn/versions

.yarn/releases/yarn-4.0.2.cjs

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableScripts: false
2+
nodeLinker: node-modules
3+
yarnPath: .yarn/releases/yarn-4.0.2.cjs

index.js renamed to index.cjs

Lines changed: 74 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
2-
plugins: ['import', 'eslint-comments', 'eslint-plugin-tsdoc', 'functional'],
32
extends: [
43
'eslint:all',
54
'plugin:@typescript-eslint/all',
@@ -8,40 +7,56 @@ module.exports = {
87
'plugin:functional/all',
98
'prettier',
109
],
10+
plugins: ['import', 'eslint-comments', 'eslint-plugin-tsdoc', 'functional'],
1111
rules: {
12-
'max-lines': ['error', 1000],
13-
'max-params': ['error', 3],
14-
complexity: ['error', 5],
15-
'max-statements': 'off',
16-
'max-lines-per-function': 'off',
17-
'default-case': 'off',
18-
'@typescript-eslint/ban-ts-ignore': 'off', // deprecated in favor of @typescript-eslint/ban-ts-comment
19-
'@typescript-eslint/no-type-alias': 'off',
20-
'tsdoc/syntax': 'warn',
21-
'line-comment-position': ['error', { ignorePattern: 'cspell' }],
22-
'no-inline-comments': 'off',
23-
'capitalized-comments': 'off',
24-
'id-length': 'off',
25-
'no-undefined': 'off',
12+
'@typescript-eslint/consistent-indexed-object-style': [
13+
'error',
14+
'index-signature',
15+
],
16+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
17+
'@typescript-eslint/explicit-function-return-type': 'off',
18+
'@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'@typescript-eslint/max-params': 'error',
20+
'@typescript-eslint/naming-convention': [
21+
'error',
22+
{
23+
format: ['camelCase'],
24+
leadingUnderscore: 'allow',
25+
selector: 'default',
26+
},
27+
{
28+
format: ['camelCase', 'UPPER_CASE'],
29+
leadingUnderscore: 'allow',
30+
selector: 'variable',
31+
},
32+
{ format: ['PascalCase'], selector: 'typeLike' },
33+
{ selector: 'enumMember', format: ['camelCase', 'UPPER_CASE'] }, // Allow UPPER_CASE for opcodes
34+
],
35+
'@typescript-eslint/no-loss-of-precision': ['error'],
2636
'@typescript-eslint/no-magic-numbers': [
2737
'error',
2838
{
29-
ignoreNumericLiteralTypes: true,
30-
ignoreEnums: true,
31-
ignoreArrayIndexes: true,
3239
ignore: [-1, 0, 1, '-1n', '0n', '1n'],
40+
ignoreArrayIndexes: true,
41+
ignoreEnums: true,
42+
ignoreNumericLiteralTypes: true,
3343
},
3444
],
35-
'@typescript-eslint/restrict-template-expressions': [
45+
'@typescript-eslint/no-unused-vars': 'off', // already checked by TypeScript's noUnusedLocals and noUnusedParameters (this rule emits false positives on TSDoc `@link` usage)
46+
'@typescript-eslint/prefer-literal-enum-member': [
3647
'error',
37-
{ allowNumber: true },
48+
{ allowBitwiseExpressions: true },
3849
],
39-
'eslint-comments/disable-enable-pair': [
50+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
51+
'@typescript-eslint/restrict-template-expressions': [
4052
'error',
41-
{
42-
allowWholeFile: true,
43-
},
53+
{ allowNumber: true },
4454
],
55+
'@typescript-eslint/typedef': 'off',
56+
'capitalized-comments': 'off',
57+
complexity: ['error', 5],
58+
'default-case': 'off',
59+
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
4560
'eslint-comments/no-aggregating-enable': 'error',
4661
'eslint-comments/no-duplicate-disable': 'error',
4762
'eslint-comments/no-unlimited-disable': 'error',
@@ -59,58 +74,59 @@ module.exports = {
5974
],
6075
},
6176
],
77+
'functional/functional-parameters': [
78+
'error',
79+
{
80+
allowArgumentsKeyword: false,
81+
allowRestParameter: false,
82+
enforceParameterCount: false,
83+
},
84+
],
85+
'functional/no-conditional-statements': [
86+
'error',
87+
{ allowReturningBranches: true },
88+
],
89+
'functional/prefer-immutable-types': 'off',
90+
'functional/type-declaration-immutability': 'off',
91+
'id-length': 'off',
92+
'import/extensions': ['error', 'always'],
6293
'import/first': 'error',
6394
'import/newline-after-import': 'error',
6495
'import/no-absolute-path': 'error',
6596
'import/no-amd': 'error',
97+
'import/no-commonjs': 'error',
6698
'import/no-cycle': 'error',
6799
'import/no-default-export': 'error',
100+
'import/no-duplicates': 'error',
101+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
102+
'import/no-internal-modules': ['error'],
68103
'import/no-mutable-exports': 'error',
69104
'import/no-named-default': 'error',
70-
'import/no-commonjs': 'error',
71105
'import/no-named-export': 'off',
72106
'import/no-self-import': 'error',
73107
'import/no-useless-path-segments': 'error',
74-
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
75108
'import/order': [
76109
'error',
77-
{
78-
'newlines-between': 'always',
79-
alphabetize: {
80-
order: 'asc',
81-
},
82-
},
83-
],
84-
'no-duplicate-imports': 'off',
85-
'import/no-duplicates': 'error',
86-
'sort-imports': [
87-
'error',
88-
{
89-
ignoreDeclarationSort: true,
90-
ignoreCase: true,
91-
},
110+
{ alphabetize: { order: 'asc' }, 'newlines-between': 'always' },
92111
],
93112
'import/prefer-default-export': 'off',
94-
'functional/no-conditional-statements': [
95-
'error',
96-
{ allowReturningBranches: true },
97-
],
98-
'@typescript-eslint/explicit-function-return-type': 'off',
99-
'@typescript-eslint/explicit-module-boundary-types': 'off',
100-
'@typescript-eslint/prefer-literal-enum-member': [
101-
'error',
102-
{ allowBitwiseExpressions: true },
103-
],
104-
'one-var': 'off',
105-
'@typescript-eslint/typedef': 'off',
106-
'no-ternary': 'off',
113+
'line-comment-position': ['error', { ignorePattern: 'cspell' }],
114+
'max-lines': ['error', 1000],
115+
'max-lines-per-function': 'off',
116+
'max-params': 'off',
117+
'max-statements': 'off',
118+
'no-duplicate-imports': 'off',
119+
'no-inline-comments': 'off',
120+
'no-loss-of-precision': 'off',
107121
'no-nested-ternary': 'off',
122+
'no-ternary': 'off',
123+
'no-undefined': 'off',
108124
'no-warning-comments': 'off',
109-
'no-loss-of-precision': 'off',
110-
'@typescript-eslint/no-loss-of-precision': ['error'],
111-
'@typescript-eslint/consistent-indexed-object-style': [
125+
'one-var': 'off',
126+
'sort-imports': [
112127
'error',
113-
'index-signature',
128+
{ ignoreCase: true, ignoreDeclarationSort: true },
114129
],
130+
'tsdoc/syntax': 'warn',
115131
},
116132
};

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
"name": "eslint-config-bitauth",
33
"version": "4.0.1",
44
"description": "eslint configuration for bitauth projects",
5-
"main": "index.js",
5+
"main": "index.cjs",
66
"license": "MIT",
77
"peerDependencies": {
8-
"@typescript-eslint/parser": ">=5.9",
8+
"@typescript-eslint/eslint-plugin": ">=6",
9+
"@typescript-eslint/parser": ">=6",
910
"eslint": ">=8",
10-
"eslint-plugin-eslint-comments": ">=3.2",
11-
"eslint-plugin-functional": ">=5",
12-
"eslint-plugin-import": ">=2.25",
13-
"typescript": ">=4.5"
14-
},
15-
"dependencies": {
16-
"@typescript-eslint/eslint-plugin": "5.59.8",
17-
"eslint-config-prettier": "^8.8.0"
11+
"eslint-config-prettier": ">=9",
12+
"eslint-plugin-eslint-comments": ">=3",
13+
"eslint-plugin-functional": ">=6",
14+
"eslint-plugin-import": ">=2",
15+
"eslint-plugin-tsdoc": ">=0.2",
16+
"typescript": ">=5"
1817
},
1918
"scripts": {
2019
"release": "standard-version"
@@ -30,5 +29,6 @@
3029
"commitizen": {
3130
"path": "cz-conventional-changelog"
3231
}
33-
}
32+
},
33+
"packageManager": "[email protected]"
3434
}

0 commit comments

Comments
 (0)