Skip to content

Commit

Permalink
Fixes #21575 - Use hound to run eslint
Browse files Browse the repository at this point in the history
Adding eslint to hound.yml, fixing lint errors,
and adding eslint-plugin-prettier for prettier
enforcement.

http://projects.theforeman.org/issues/21575
  • Loading branch information
danseethaler authored and ehelms committed Nov 16, 2017
1 parent a89c0bb commit ddc7731
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 17 deletions.
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread", "transform-class-properties"]
"presets": [
"env",
"react"
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties"
]
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore all files except webpack directory
**/*.js
!webpack/**/*.js
17 changes: 17 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"jest/globals": true
},
"extends": [
"airbnb",
"plugin:jest/recommended"
],
"plugins": [
"jest",
"react"
],
"rules": {
"react/jsx-filename-extension": "off"
}
}
11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jshint:
enabled: false

eslint:
enabled: false
enabled: true
config_file: .eslintrc
ignore_file: .eslintignore

fail_on_violations: true
3 changes: 3 additions & 0 deletions engines/bastion_katello/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"root": true
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"test": "jest webpack",
"test:watch": "jest webpack --watchAll",
"test:current": "jest webpack --watch",
"format": "prettier --single-quote --trailing-comma es5 --write 'webpack/**/*.js' '*.{js,json}'",
"format": "prettier --single-quote --trailing-comma es5 --write 'webpack/**/*.js'",
"build": "npm run format && npm run lint",
"lint": "eslint --fix webpack/index.js || exit 0"
"lint": "eslint --fix webpack/ || exit 0"
},
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions webpack/containers/Application/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Welcome from '../../scenes/Welcome';
import Dashboard from '../../scenes/Dashboard';
import Repos from '../../scenes/Repos';

// eslint-disable-next-line import/prefer-default-export
export const links = [
{
text: 'Welcome',
Expand Down
5 changes: 4 additions & 1 deletion webpack/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { applyMiddleware } from 'redux';
/* eslint import/no-unresolved: [2, { ignore: [foremanReact/*] }] */
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable import/extensions */

import componentRegistry from 'foremanReact/components/componentRegistry';
import { mount } from 'foremanReact/common/MountingService';
Expand All @@ -10,4 +13,4 @@ componentRegistry.register({
type: ExperimentalUi,
});

mount('xui_katello', '#reactRoot');
mount('xui_katello', '#reactRoot');

0 comments on commit ddc7731

Please sign in to comment.