Skip to content

Commit

Permalink
Do linting via webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Aug 20, 2018
1 parent a51ccba commit cf794b6
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 288 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
include:
- stage: test
script:
- yarn lint
- yarn build
- yarn test:ci
after_script:
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function(config) {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['chai', 'mocha'],
frameworks: ['mocha'],

// list of files / patterns to load in the browser
files: [
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
"clean": "rm -rf dist",
"cy:open": "./node_modules/.bin/cypress open",
"cy:run": "./node_modules/.bin/cypress run",
"lint:js": "eslint .",
"lint:styles": "stylelint ./src/css/**/*.scss ./docs/welcome/sass/welcome.scss",
"lint": "yarn lint:js && yarn lint:styles",
"start": "yarn watch",
"start-test-server": "http-server",
"test:ci": "yarn test:unit:ci && yarn test:cy:ci",
Expand Down Expand Up @@ -63,6 +60,7 @@
"cypress": "^3.0.3",
"del": "^3.0.0",
"eslint": "^5.1.0",
"eslint-loader": "^2.1.0",
"eslint-plugin-mocha": "^5.1.0",
"eslint-plugin-ship-shape": "^0.6.0",
"extract-loader": "^2.0.1",
Expand All @@ -71,7 +69,6 @@
"http-server": "^0.11.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^3.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.0.1",
Expand All @@ -88,7 +85,6 @@
"source-map-loader": "^0.2.3",
"start-server-and-test": "^1.7.0",
"style-loader": "^0.22.1",
"stylelint": "^9.4.0",
"stylelint-config-ship-shape": "^0.4.0",
"stylelint-webpack-plugin": "^0.10.5",
"uglifyjs-webpack-plugin": "^1.3.0",
Expand Down
36 changes: 22 additions & 14 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,28 @@ module.exports.push({
}
},
module: {
rules: [{
test: /\.js$/,
exclude: path.resolve(__dirname, 'node_modules'),
include: [
path.resolve(__dirname, 'src/js')
],
use: [{
loader: 'babel-loader',
options: {
'plugins': ['lodash'],
'presets': [['env', { 'modules': false, 'targets': { 'node': 6 } }]]
}
}]
}]
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: path.resolve(__dirname, 'node_modules'),
loader: 'eslint-loader',
},
{
test: /\.js$/,
exclude: path.resolve(__dirname, 'node_modules'),
include: [
path.resolve(__dirname, 'src/js')
],
use: [{
loader: 'babel-loader',
options: {
'plugins': ['lodash'],
'presets': [['env', { 'modules': false, 'targets': { 'node': 6 } }]]
}
}]
}
]
},
externals: {
'popper.js': {
Expand Down
Loading

0 comments on commit cf794b6

Please sign in to comment.