Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chungweileong94/craco-eslint-webpack-plugin
A craco plugin for replacing eslint-loader with eslint-webpack-plugin
https://github.com/chungweileong94/craco-eslint-webpack-plugin
Last synced: about 1 month ago
JSON representation
A craco plugin for replacing eslint-loader with eslint-webpack-plugin
- Host: GitHub
- URL: https://github.com/chungweileong94/craco-eslint-webpack-plugin
- Owner: chungweileong94
- License: mit
- Created: 2020-10-09T12:07:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-14T02:26:21.000Z (almost 4 years ago)
- Last Synced: 2024-10-08T11:32:30.736Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# craco-eslint-webpack-plugin
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![npm](https://img.shields.io/npm/v/craco-eslint-webpack-plugin?color=%232bcf3e)](https://www.npmjs.com/package/craco-eslint-webpack-plugin)A [craco](https://github.com/gsoft-inc/craco) plugin for replacing eslint-loader with [eslint-webpack-plugin](https://github.com/webpack-contrib/eslint-webpack-plugin)
## NOTE: This plugin only works with craco v5.8.x
## Installation
1. Install [craco](https://github.com/gsoft-inc/craco)
2. Install `craco-eslint-webpack-plugin` :
NPM
```
npm install craco-eslint-webpack-plugin --save-dev
```Yarn
```
yarn add craco-eslint-webpack-plugin -D
```3. Install `eslint-webpack-plugin` & `eslint` :
NPM
```
npm install eslint-webpack-plugin eslint --save-dev
```Yarn
```
yarn add eslint-webpack-plugin eslint -D
```4. Edit `craco.config.js` :
```js
const CracoEslintWebpackPlugin = require('craco-eslint-webpack-plugin');module.exports = {
plugins: [
{
plugin: CracoEslintWebpackPlugin,
options: {
// See the options description below
skipPreflightCheck: true,
eslintOptions: {
files: 'src/**/*.{js,jsx,ts,tsx}',
lintDirtyModulesOnly: true,
// ...
},
},
},
],
};
```## Options
- `skipPreflightCheck`
- `eslint-webpack-plugin` required `eslint` with version `^7.5.0`, which doesn't match the version that came with the CRA, and stop you from running the app. Set this option to `true`, will set the `SKIP_PREFLIGHT_CHECK=true`, which basically to tell CRA to skip the dependencies version checking. If not, you can always add into your `.env` file.
- `eslintOptions`
- https://github.com/webpack-contrib/eslint-webpack-plugin#options