Skip to content

Commit

Permalink
ESLint v8 support (#409)
Browse files Browse the repository at this point in the history
* Add custom resolver until Jest v28 is released

* Bump eslint

* Bump min version for unicorn

* Remove eslint-plugin-eslint-comments

* Update tests for v8
  • Loading branch information
tclindner authored Dec 4, 2021
1 parent 5349654 commit ea2d903
Show file tree
Hide file tree
Showing 7 changed files with 566 additions and 1,527 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ First thing first, let's make sure you have the necessary pre-requisites.
npx install-peerdeps --dev eslint-config-tc
```

> eslint, eslint-plugin-eslint-comments, eslint-plugin-import, eslint-plugin-jest, eslint-plugin-prettier, eslint-plugin-unicorn, and prettier are peer dependencies and must be installed.
> eslint, eslint-plugin-import, eslint-plugin-jest, eslint-plugin-prettier, eslint-plugin-unicorn, and prettier are peer dependencies and must be installed.
## Usage

Expand Down
12 changes: 12 additions & 0 deletions export-maps-resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// TODO: Remove workaround for https://github.com/facebook/jest/issues/9771
// after Jest v28 is released.
// eslint-disable-next-line import/no-extraneous-dependencies
const enhancedResolve = require('enhanced-resolve');

const resolver = enhancedResolve.create.sync({
conditionNames: ['require', 'node', 'default'],
extensions: ['.js', '.json'],
mainFields: ['exports', 'main', 'require'],
});

module.exports = (request, options) => resolver(options.basedir, request);
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
extends: [
'eslint-config-airbnb-base',
'eslint:recommended',
'plugin:eslint-comments/recommended',
'plugin:jest/recommended',
'plugin:unicorn/recommended',
'eslint-config-prettier',
Expand Down Expand Up @@ -45,7 +44,6 @@ module.exports = {
rules: {
'array-bracket-newline': 'off',
'array-element-newline': 'off',
'eslint-comments/no-unused-disable': 'error',
'id-length': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
resolver: './export-maps-resolver.js',
};
Loading

0 comments on commit ea2d903

Please sign in to comment.