-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly import jest flat configs (#365)
* fix: correctly import jest flat configs * put algolia rules at the end
- Loading branch information
Showing
5 changed files
with
25 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
const jestPlugin = require('eslint-plugin-jest'); | ||
const globals = require('globals'); | ||
|
||
const jestRules = require('../rules/jest'); | ||
|
||
module.exports = [ | ||
jestRules, | ||
{ | ||
...jestPlugin.configs['flat/recommended'], | ||
}, | ||
{ | ||
...jestPlugin.configs['flat/style'], | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
}, | ||
}, | ||
}, | ||
jestRules, | ||
]; |
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
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,17 @@ | ||
describe('simple tests', () => { | ||
// Test a rule from the Algolia config | ||
// eslint-disable-next-line jest/consistent-test-it | ||
test('should do simple maths', () => { | ||
expect(Math.pow(2, 8)).toBe(256); | ||
}); | ||
|
||
// Test a rule from the recommended config (https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-commented-out-tests.md) | ||
// eslint-disable-next-line jest/no-commented-out-tests | ||
// it('foo', () => {}); | ||
|
||
it('should do simple comparison', () => { | ||
// Test a rule from the style config (https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md) | ||
// eslint-disable-next-line jest/prefer-to-be | ||
expect(0).toEqual(0); | ||
}); | ||
}); |
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