Skip to content

Commit

Permalink
feat(moreRules): Add more rules and files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Apr 4, 2016
1 parent 87805ce commit 19b142c
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 7 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Then add the extends to your `.eslintrc`:

This config lib also includes a `test` and a `test-angular` config:

**Note if you use these, you need `eslint-plugin-mocha`**
**Note if you use these, you need to install `eslint-plugin-mocha`**

```javascript
{
Expand All @@ -51,15 +51,41 @@ This config lib also includes a `test` and a `test-angular` config:

This config lib also includes a `react` config:

**Note if you use this, you'll also need `eslint-plugin-react`**:
**Note if you use this, you'll also need to install `eslint-plugin-react`**:

```javascript
{
"extends": "kentcdodds/react"
}
```

### ES.next

If you want to use ES.next goodness, you can reference the `es-next` config:

**Note if you use this, you'll also need to install `babel-eslint`**:

```javascript
{
"extends": "kentcdodds/es-next"
}
```

### webpack

We lint your import/require statements. With webpack overloading these, you may
want to have these resolved the way webpack resolves them for you.

**Note if you use this, you'll also need to install `eslint-import-resolver-webpack`**:

```javascript
{
"extends": ["kentcdodds", "kentcdodds/webpack"]
}
```



## LICENSE

MIT

4 changes: 4 additions & 0 deletions es-next.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
"extends": "./index.js",
"parser": "babel-eslint",
}
14 changes: 14 additions & 0 deletions import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
"plugins": [
"import",
],
"settings": {
"import/resolver": "",
},
"import/no-unresolved": 2,
"import/imports-first": 2,
"import/no-duplicates": 2,
"import/named": 2,
"import/default": 2,
"import/namespace": 2,
}
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
"plugins": [
"import",
],
"rules": {
"quotes": [2, "single", "avoid-escape"],
"no-use-before-define": [2, "nofunc"],
Expand Down Expand Up @@ -161,6 +164,15 @@ module.exports = {
"max-params": [2, 5],
"no-bitwise": 2,
"no-plusplus": 0,

"import/no-unresolved": 2,
"import/named": 2,
"import/default": 2,
"import/namespace": 2,
"import/export": 2,
"import/no-named-as-default": 2,
"import/imports-first": 2,
"import/no-duplicates": 2,
},
"env": {
"browser": true,
Expand All @@ -177,4 +189,3 @@ module.exports = {
"globals": {
},
}

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@
},
"homepage": "https://github.com/kentcdodds/eslint-config-kentcdodds#readme",
"peerDependencies": {
"eslint": "^2.0.0"
"eslint": "^2.0.0",
"eslint-plugin-import": "1.4.0"
},
"devDependencies": {
"babel-eslint": "6.0.2",
"commitizen": "2.7.2",
"cz-conventional-changelog": "1.1.5",
"eslint": "2.4.0",
"eslint-find-new-rules": "1.0.0",
"eslint-import-resolver-webpack": "0.2.0",
"eslint-plugin-react": "4.2.3",
"ghooks": "1.0.3",
"semantic-release": "4.3.5",
Expand Down
3 changes: 1 addition & 2 deletions react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
"extends": "./index.js",
"extends": "./es-next.js",
"env": {
"browser": true,
},
Expand Down Expand Up @@ -41,4 +41,3 @@ module.exports = {
"react/wrap-multilines": 2,
},
}

5 changes: 5 additions & 0 deletions webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"settings": {
"import/resolver": "webpack",
},
}

0 comments on commit 19b142c

Please sign in to comment.