Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load custom eslint rules as plugin, w/o --rulesdir #4034

Merged
merged 1 commit into from
Jun 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parser: babel-eslint

plugins:
- react
- react-internal

env:
browser: true
Expand Down Expand Up @@ -97,4 +98,4 @@ rules:

# CUSTOM RULES
# the second argument of warning/invariant should be a literal string
warning-and-invariant-args: 2
react-internal/warning-and-invariant-args: 2
5 changes: 5 additions & 0 deletions eslint-rules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Custom ESLint Rules

This is a dummy npm package that allows us to treat it as an eslint-plugin. It's not actually published, nor are the rules here useful for users of react. If you want to lint your react code, try <https://github.com/yannickcr/eslint-plugin-react>.

**If you modify this rule, you must re-run `npm install ./eslint-rules` for it to take effect.**
7 changes: 7 additions & 0 deletions eslint-rules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

module.exports = {
rules: {
'warning-and-invariant-args': require('./warning-and-invariant-args'),
},
};
4 changes: 4 additions & 0 deletions eslint-rules/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "eslint-plugin-react-internal",
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion grunt/tasks/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function() {
var done = this.async();
grunt.util.spawn({
cmd: 'node_modules/.bin/eslint',
args: ['.', '--rulesdir=eslint-rules'],
args: ['.'],
opts: {stdio: 'inherit'}, // allows colors to passthrough
}, function(err, result, code) {
if (err) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"es5-shim": "^4.0.0",
"eslint": "^0.21.2",
"eslint-plugin-react": "^2.5.0",
"eslint-plugin-react-internal": "file:eslint-rules",
"eslint-tester": "^0.7.0",
"grunt": "~0.4.2",
"grunt-cli": "^0.1.13",
Expand Down