Skip to content

Commit

Permalink
Add eslint with CI staged files linting
Browse files Browse the repository at this point in the history
Add lint:ci script

This will lint all changed files in the branch / Travis commit range.

Update Travis config to lint changed files before build
  • Loading branch information
tcrammond committed Jan 29, 2019
1 parent 6ed8c0e commit 7f49bba
Show file tree
Hide file tree
Showing 6 changed files with 2,165 additions and 274 deletions.
61 changes: 61 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module.exports = {
extends: 'standard',
globals: {
$: false
},
rules: {
'semi': [2, 'always'],
'no-mixed-operators': 'off',
'no-unused-expressions': 'off',
'no-var': 'error',
'one-var': [2, 'never'],
'prefer-const': 'error',
'operator-linebreak': [
'error',
'after',
{ overrides: { '?': 'before', ':': 'before', '|>': 'before' } }
],
radix: 'error',
'require-await': 'error'
},
env: {
browser: true
},
overrides: [
{
files: ['src/scripts/*.js'],
globals: {
db: false,
togglbutton: false,
TogglButton: false,
chrome: false,
ga: false
}
},
{
files: ['src/scripts/content.js'],
globals: {
createTag: false
}
},
{
files: ['src/scripts/common.js'],
globals: {
createTag: false
}
},
{
files: ['src/scripts/popup.js'],
globals: {
PopUp: false,
Db: false
}
},
{
files: ['src/scripts/content/*.js'],
globals: {
togglbutton: false
}
}
]
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!.editorconfig
!.gitignore
!.travis.yml
!.eslintrc.js

dist/
node_modules/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_js:
- 8.11.3

before_script:
- npm run xo
- npm run lint:ci

script:
- npm run build
Expand Down
Loading

0 comments on commit 7f49bba

Please sign in to comment.