Skip to content

Commit

Permalink
feat: complexity
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add rule `complexity` and bump min eslint v9.12.0.
  • Loading branch information
mightyiam committed Nov 30, 2024
1 parent 88db66f commit 2f24687
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 106 deletions.
173 changes: 70 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"typescript-eslint": "^8.15.0"
},
"peerDependencies": {
"eslint": "^9.0.0",
"eslint": "^9.12.0",
"typescript": "*"
},
"devDependencies": {
Expand All @@ -80,7 +80,7 @@
"ava": "6.2.0",
"conventional-changelog-conventionalcommits": "8.0.0",
"eslint": "9.16.0",
"eslint_bottom": "npm:eslint@9.0.0",
"eslint_bottom": "npm:eslint@9.12.0",
"eslint-plugin-eslint-comments_bottom": "npm:eslint-plugin-eslint-comments@3.2.0",
"eslint-plugin-import_bottom": "npm:eslint-plugin-import@2.31.0",
"eslint-plugin-n_bottom": "npm:eslint-plugin-n@17.0.0",
Expand Down
8 changes: 8 additions & 0 deletions src/plugin-usage/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const usage: PluginUsage = {
'as-needed',
{ requireReturnForObjectLiteral: false },
],
complexity: [
'error',
{
variant: 'modified',
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- arbitrary choice
max: 5,
},
],
'constructor-super': ['error'],
curly: ['error', 'multi-line'],
'default-case-last': ['error'],
Expand Down
8 changes: 8 additions & 0 deletions src/test/_expected-exported-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ export const expectedEslintRules: Record<
'as-needed',
{ requireReturnForObjectLiteral: false },
],
complexity: [
'error',
{
variant: 'modified',
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- arbitrary choice
max: 5,
},
],
'constructor-super': ['error'],
curly: ['error', 'multi-line'],
'default-case-last': ['error'],
Expand Down
1 change: 0 additions & 1 deletion src/test/_rules_to_consider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const rulesToConsider: Record<string, string[]> = {
'eslint-comments': [],
'': [
'complexity',
'consistent-this',
'default-case',
'for-direction',
Expand Down

0 comments on commit 2f24687

Please sign in to comment.