Skip to content

Commit

Permalink
chore: workaround FlatRuleTester test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Mar 18, 2024
1 parent 4758d20 commit 9813b75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const eslintPkg = require('eslint/package.json')
const semver = require('semver')

/**
* @type {import('eslint').Linter.Config}
*/
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
root: true,
extends: [
Expand All @@ -10,9 +12,11 @@ module.exports = {
'plugin:eslint-plugin/recommended',
'plugin:import-x/recommended',
'plugin:n/recommended',
'plugin:unicorn/recommended',
semver.satisfies(eslintPkg.version, '>=8')
? 'plugin:unicorn/recommended'

Check warning on line 16 in .eslintrc.js

View check run for this annotation

Codecov / codecov/patch

.eslintrc.js#L16

Added line #L16 was not covered by tests
: undefined,
'plugin:prettier/recommended',
],
].filter(Boolean),
env: {
node: true,
es6: true,
Expand Down
6 changes: 5 additions & 1 deletion test/rules/no-unused-modules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,11 @@ try {
}

;(FlatRuleTester ? describe : describe.skip)('supports flat eslint', () => {
const flatRuleTester = new FlatRuleTester!()
if (typeof FlatRuleTester !== 'function') {
return
}

const flatRuleTester = new FlatRuleTester()
flatRuleTester.run('no-unused-modules', rule, {
valid: [
{
Expand Down

0 comments on commit 9813b75

Please sign in to comment.