-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat!: migrate to ESLint flat config
Showing
10 changed files
with
459 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import base from './base.js'; | ||
import jsdoc from './jsdoc.js'; | ||
import unicorn from './unicorn.js'; | ||
|
||
export default [...base, ...jsdoc, ...unicorn]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
'use strict'; | ||
import jsdoc from 'eslint-plugin-jsdoc'; | ||
|
||
module.exports = { | ||
plugins: ['jsdoc'], | ||
extends: ['plugin:jsdoc/recommended'], | ||
settings: { | ||
jsdoc: { | ||
ignoreInternal: true, | ||
maxLines: 3, | ||
}, | ||
}, | ||
rules: { | ||
'jsdoc/require-jsdoc': [ | ||
'warn', | ||
{ | ||
publicOnly: true, | ||
export default [ | ||
jsdoc.configs['flat/recommended'], | ||
{ | ||
settings: { | ||
jsdoc: { | ||
ignoreInternal: true, | ||
maxLines: 3, | ||
}, | ||
], | ||
'jsdoc/require-asterisk-prefix': 'warn', | ||
'jsdoc/require-description': 'warn', | ||
'jsdoc/require-hyphen-before-param-description': 'warn', | ||
}, | ||
rules: { | ||
'jsdoc/require-jsdoc': [ | ||
'warn', | ||
{ | ||
publicOnly: true, | ||
}, | ||
], | ||
'jsdoc/require-asterisk-prefix': 'warn', | ||
'jsdoc/require-description': 'warn', | ||
'jsdoc/require-hyphen-before-param-description': 'warn', | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.{ts,tsx,cts,mts}'], | ||
rules: { | ||
'jsdoc/require-param-type': 'off', | ||
'jsdoc/require-returns-type': 'off', | ||
'jsdoc/no-types': 'warn', | ||
}, | ||
{ | ||
files: ['**/*.{ts,tsx,cts,mts}'], | ||
rules: { | ||
'jsdoc/require-param-type': 'off', | ||
'jsdoc/require-returns-type': 'off', | ||
'jsdoc/no-types': 'warn', | ||
}, | ||
], | ||
}; | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
'use strict'; | ||
|
||
import '/absolute/path'; | ||
|
||
console.log('abc'); | ||
|
||
let a; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,52 @@ | ||
'use strict'; | ||
import unicorn from 'eslint-plugin-unicorn'; | ||
|
||
module.exports = { | ||
plugins: ['unicorn'], | ||
extends: ['plugin:unicorn/recommended'], | ||
rules: { | ||
// We are not consistent enough to enable this rule. | ||
'unicorn/filename-case': 'off', | ||
// Flags i,j,k, etc. | ||
'unicorn/prevent-abbreviations': 'off', | ||
// TODO: create issue about risk (>32bit integers) | ||
'unicorn/prefer-math-trunc': 'off', | ||
// We prefer Array.from(x) over [...x] | ||
'unicorn/prefer-spread': 'off', | ||
// We prefer new Array(x).fill() over Array.from({ length: x }) | ||
'unicorn/no-new-array': 'off', | ||
// We don't like separators after the comma | ||
'unicorn/numeric-separators-style': 'off', | ||
// For loop is used sometimes for performance. | ||
'unicorn/no-for-loop': 'off', | ||
// We use null in many places. | ||
'unicorn/no-null': 'off', | ||
'unicorn/switch-case-braces': 'off', | ||
'unicorn/prefer-ternary': 'off', | ||
'unicorn/prefer-type-error': 'off', | ||
// Might want to enable in a future semver-major. | ||
'unicorn/no-negated-condition': 'off', | ||
'unicorn/no-useless-undefined': 'off', | ||
// Conflicts with Prettier. | ||
'unicorn/number-literal-case': 'off', | ||
// Too early for full ESM | ||
'unicorn/prefer-module': 'off', | ||
// Conflicts with Prettier. | ||
'unicorn/no-nested-ternary': 'off', | ||
// Problematic with useOnOff | ||
'unicorn/no-unreadable-array-destructuring': 'off', | ||
'unicorn/prefer-regexp-test': 'off', | ||
// Unfortunately too annoying on valid cases + conflicts with TS. | ||
'unicorn/no-array-callback-reference': 'off', | ||
// May conflict with other rule + ugly switch(0) auto-fix. | ||
'unicorn/prefer-switch': 'off', | ||
// Rare and problematic with APIs that have a find method. | ||
'unicorn/no-array-method-this-argument': 'off', | ||
// We don't use the feature. | ||
'unicorn/expiring-todo-comments': 'off', | ||
// Doesn't work with typescript-eslint v6 at the moment. | ||
'unicorn/no-empty-file': 'off', | ||
// We already have a rule for anonymous functions and tooling often does this with config. | ||
'unicorn/no-anonymous-default-export': 'off', | ||
export default [ | ||
unicorn.configs['flat/recommended'], | ||
{ | ||
rules: { | ||
// We are not consistent enough to enable this rule. | ||
'unicorn/filename-case': 'off', | ||
// Flags i,j,k, etc. | ||
'unicorn/prevent-abbreviations': 'off', | ||
// TODO: create issue about risk (>32bit integers) | ||
'unicorn/prefer-math-trunc': 'off', | ||
// We prefer Array.from(x) over [...x]. | ||
'unicorn/prefer-spread': 'off', | ||
// We prefer new Array(x).fill() over Array.from({ length: x }). | ||
'unicorn/no-new-array': 'off', | ||
// We don't like separators after the comma. | ||
'unicorn/numeric-separators-style': 'off', | ||
// For loop is used sometimes for performance. | ||
'unicorn/no-for-loop': 'off', | ||
// We use null in many places. | ||
'unicorn/no-null': 'off', | ||
'unicorn/switch-case-braces': 'off', | ||
'unicorn/prefer-ternary': 'off', | ||
'unicorn/prefer-type-error': 'off', | ||
// Might want to enable in a future semver-major. | ||
'unicorn/no-negated-condition': 'off', | ||
'unicorn/no-useless-undefined': 'off', | ||
// Conflicts with Prettier. | ||
'unicorn/number-literal-case': 'off', | ||
// Too early for full ESM. | ||
'unicorn/prefer-module': 'off', | ||
// Conflicts with Prettier. | ||
'unicorn/no-nested-ternary': 'off', | ||
// Problematic with useOnOff. | ||
'unicorn/no-unreadable-array-destructuring': 'off', | ||
'unicorn/prefer-regexp-test': 'off', | ||
// Unfortunately too annoying on valid cases + conflicts with TS. | ||
'unicorn/no-array-callback-reference': 'off', | ||
// May conflict with other rule + ugly switch(0) auto-fix. | ||
'unicorn/prefer-switch': 'off', | ||
// Rare and problematic with APIs that have a find method. | ||
'unicorn/no-array-method-this-argument': 'off', | ||
// We don't use the feature. | ||
'unicorn/expiring-todo-comments': 'off', | ||
// Doesn't work with typescript-eslint v6 at the moment. | ||
'unicorn/no-empty-file': 'off', | ||
// We already have a rule for anonymous functions and tooling often does this with config. | ||
'unicorn/no-anonymous-default-export': 'off', | ||
}, | ||
}, | ||
}; | ||
]; |