1.0.0 • Published 5 years ago
craco-eslint-webpack-plugin v1.0.0
craco-eslint-webpack-plugin
A craco plugin for replacing eslint-loader with eslint-webpack-plugin
Installation
Install craco
Install
craco-eslint-webpack-plugin:NPM
npm install craco-eslint-webpack-plugin --save-devYarn
yarn add craco-eslint-webpack-plugin -DInstall
eslint-webpack-plugin&eslint:NPM
npm install eslint-webpack-plugin eslint --save-devYarn
yarn add eslint-webpack-plugin eslint -DEdit
craco.config.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
skipPreflightCheckeslint-webpack-pluginrequiredeslintwith 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 totrue, will set theSKIP_PREFLIGHT_CHECK=true, which basically to tell CRA to skip the dependencies version checking. If not, you can always add into your.envfile.
eslintOptions
1.0.0
5 years ago