Skip to content

Commit

Permalink
Add ESLint to dev builds and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Cherewaty committed Sep 11, 2017
1 parent c53b330 commit 62de42b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ install:
cache:
yarn: true
script:
- yarn lint
- yarn test -- --single-run
before_deploy:
- environment=production yarn build
Expand Down
6 changes: 6 additions & 0 deletions demo/stripes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ commander
if (options.cache) config.plugins.push(cachePlugin);
if (options.devtool) config.devtool = options.devtool;

// Show eslint failures at runtime
config.module.rules.push({
test: /src\/.*\.js$/,
loader: 'eslint-loader'
});

const compiler = webpack(mirage(svgloader(config)));

const port = options.port || process.env.STRIPES_PORT || 3000;
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"postinstall": "bin/link-self",
"start": "node demo/stripes.js dev demo/stripes.config.js",
"build": "node demo/stripes.js build demo/stripes.config.js dist",
"test": "karma start"
"test": "karma start",
"lint": "eslint src"
},
"devDependencies": {
"@folio/stripes-core": "thefrontside/stripes-core#master",
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
Expand Down

0 comments on commit 62de42b

Please sign in to comment.