eslint-plugin-no-allow-react-context
v1.0.1
Published
Not allow to use React context in specific directory.
Downloads
51
Readme
eslint-plugin-no-allow-react-context
Not allow to use React context in specific directory.
class Component extends React.Component {
static contextTypes = {}; // <= Error
}
Install
Install with npm:
npm install eslint-plugin-no-allow-react-context
Usage
Add eslint-plugin-no-allow-react-context to .eslintrc
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"no-allow-react-context"
],
"rules": {
"no-allow-react-context/no-allow-react-context": [2, {
"except": ["expect/dir/pattern/**/*.js"]
}]
}
}
except
:string[]
- expect glob pattern
- If the pattern match the file name, the file should be ignored.
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu