Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 094635d

Browse files
author
Daniel Brook-Roberge
authored
Merge pull request #117 from mobify/es6-indent-fix
Minor ES6 fixes
2 parents bd23862 + fc30efa commit 094635d

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
2.5.2
2+
- Update ES6 indent rule on switch statements
3+
- Add ignore patterns for unused vars/args to the React configuration
4+
- Ignore non-JS files and node_modules in the ES6 import module
25
- Add a new ES5 configuration ported to ESLint 2 and up
36
2.5.1
47
- Update line length to 200

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ extends:
7474
- './node_modules/mobify-code-style/es6/mobify-es6-react.yml'
7575
```
7676
77+
If using a custom Webpack configuration, add the lines:
78+
```yaml
79+
settings:
80+
import/resolver:
81+
webpack:
82+
config: '<path-to-webpack-config>'
83+
```
84+
to the `.eslintrc.yml`
85+
7786
Make sure to install the following NPM modules:
7887
- `eslint` > 3.0
7988
- `eslint-plugin-import`

es6/mobify-es6-react.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ rules:
3434
react/jsx-indent-props: error
3535
react/jsx-space-before-closing: error
3636
react/wrap-multilines: error
37+
38+
# Ignore common unused vars and args in React projects
39+
no-unused-vars:
40+
- error
41+
- varsIgnorePattern: '^(styles)$'
42+
argsIgnorePattern: '^(props|dispatch|state)$'

es6/mobify-es6.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ parserOptions:
1111
sourceType: module
1212
settings:
1313
import/resolver: webpack
14+
import/ignore:
15+
- node_modules
16+
- \.(scss|css|html)$
1417
rules:
1518
# Allow logging for debug purposes
1619
no-console: 'off'
@@ -132,7 +135,10 @@ rules:
132135
dot-notation: error
133136
eol-last: error
134137
generator-star-spacing: error
135-
indent: error
138+
indent:
139+
- error
140+
- 4
141+
- SwitchCase: 1
136142
jsx-quotes: error
137143
key-spacing: error
138144
keyword-spacing: error

0 commit comments

Comments
 (0)