-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e81df8c
commit 6770776
Showing
5 changed files
with
382 additions
and
22 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
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,33 @@ | ||
# ESLint Plugin | ||
|
||
Find problems in your code on build step | ||
|
||
## Install | ||
|
||
``` | ||
npm install -D @rambler-tech/razzle-eslint eslint | ||
``` | ||
|
||
or | ||
|
||
``` | ||
yarn add -D @rambler-tech/razzle-eslint eslint | ||
``` | ||
|
||
## Usage | ||
|
||
Add the plugin to `razzle.config.js` | ||
|
||
```js | ||
const ESLintPlugin = require('@rambler-tech/razzle-eslint') | ||
|
||
module.exports = { | ||
plugins: [ | ||
ESLintPlugin(), | ||
], | ||
modifyWebpackConfig({webpackConfig}) { | ||
// ... | ||
return webpackConfig | ||
} | ||
} | ||
``` |
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,16 @@ | ||
const ESLintPlugin = require('eslint-webpack-plugin') | ||
const formatter = require('react-dev-utils/eslintFormatter') | ||
|
||
module.exports = (options = {}) => ({ | ||
modifyWebpackConfig({webpackConfig}) { | ||
webpackConfig.plugins = [ | ||
new ESLintPlugin({ | ||
...options, | ||
formatter | ||
}), | ||
...webpackConfig.plugins | ||
] | ||
|
||
return webpackConfig | ||
} | ||
}) |
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,19 @@ | ||
{ | ||
"name": "@rambler-tech/razzle-eslint", | ||
"version": "0.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"eslint-webpack-plugin": "^4.1.0", | ||
"react-dev-utils": "^12.0.1" | ||
}, | ||
"peerDependencies": { | ||
"razzle": ">=4", | ||
"webpack": ">=5", | ||
"eslint": ">=8" | ||
} | ||
} |
Oops, something went wrong.