Skip to content

Commit

Permalink
chore: tweak jest lint config (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish authored Sep 5, 2022
1 parent a693d12 commit 656bc97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ module.exports = {

// Jest rules:
'jest/no-conditional-expect': 'off',
'jest/no-standalone-expect': 'off', // False positives from using: verifyResults(results) { expect(results).toMatchInlineSnapshot }

// Node rules:
'node/no-unsupported-features/es-syntax': [
Expand Down Expand Up @@ -149,24 +148,28 @@ module.exports = {

overrides: [
{
// CJS
files: ['**/*.cjs'],
parserOptions: {
sourceType: 'script',
},
},
{
// CLI
files: ['bin/**/*.js', 'lib/helpers/cli.js'],
rules: {
'no-console': 'off',
},
},
{
// Rules
files: ['lib/rules/**/*.js'],
rules: {
'filenames/match-exported': ['error', 'kebab'],
},
},
{
// Tests
files: ['test/**/*.js'],
env: {
jest: true,
Expand All @@ -175,5 +178,12 @@ module.exports = {
'import/no-dynamic-require': 'off',
},
},
{
// Rule tests
files: ['test/unit/rules/*.js'],
rules: {
'jest/no-standalone-expect': 'off', // False positives from using: verifyResults(results) { expect(results).toMatchInlineSnapshot }
},
},
],
};
2 changes: 1 addition & 1 deletion test/acceptance/rule-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint jest/expect-expect:"off" -- false positives due to the lint framework running some tests for us */
/* eslint jest/expect-expect:"off",jest/no-standalone-expect:"off" -- false positives due to the lint framework running some tests for us */
import path from 'node:path';

import defaultTestHarness from '../../lib/helpers/rule-test-harness.js';
Expand Down

0 comments on commit 656bc97

Please sign in to comment.