https://github.com/flexdinesh/cra-babel-eslint
Example babel transform and eslint plugins demo for my talk at React Sydney on Nov 4, 2019.
https://github.com/flexdinesh/cra-babel-eslint
Last synced: about 1 year ago
JSON representation
Example babel transform and eslint plugins demo for my talk at React Sydney on Nov 4, 2019.
- Host: GitHub
- URL: https://github.com/flexdinesh/cra-babel-eslint
- Owner: flexdinesh
- Created: 2019-11-02T12:24:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T06:53:49.000Z (about 5 years ago)
- Last Synced: 2025-03-15T21:15:46.093Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRA babel-eslint
Example babel transform and eslint plugins developed for my talk at React Sydney on Nov 4, 2019.
## Installation
### babel transform plugins
Import and add the plugins to babel config.
.babelrc.js
```js
const babelTransformLogRender = require("./plugins/babel-transform-log-render");
const babelTransformLogStateChange = require("./plugins/babel-transform-log-state-change");
module.exports = {
presets: ["react-app"],
plugins: [babelTransformLogRender, babelTransformLogStateChange] // plugin goes here
};
```
### esling plugins
Install the plugin locally in destination project by using the right local path:
```
$ yarn add ../eslint-plugin-dinesh-says-no --dev
```
Add `dinesh-says-no` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": ["dinesh-says-no"]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"dinesh-says-no/no-cats": "error"
}
}
```