Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Change linter configuration to be compatible with prettier 💄
Browse files Browse the repository at this point in the history
  • Loading branch information
pirelenito committed Apr 23, 2017
1 parent 9e70dbe commit d5ca200
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"template"
],
"scripts": {
"build": "rm -rf lib && babel src --out-dir lib --ignore *.spec.js && cp src/sagui-config-schema.json lib/sagui-config-schema.json",
"build": "rm -rf lib && babel src --out-dir lib --ignore *.spec.js && cp src/sagui-config-schema.json lib/sagui-config-schema.json && cp src/configure-webpack/loaders/javascript-eslintrc.json lib/configure-webpack/loaders/javascript-eslintrc.json",
"test": "npm run test:lint && npm run test:unit && npm run test:integration",
"test:lint": "standard | snazzy",
"test:lint:fix": "standard --fix",
Expand Down Expand Up @@ -77,7 +77,14 @@
"clean-webpack-plugin": "^0.1.16",
"commander": "^2.9.0",
"css-loader": "^0.28.0",
"eslint-plugin-flowtype": "^2.30.4",
"eslint": "^3.19.0",
"eslint-config-prettier": "^1.7.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-flowtype": "^2.32.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.11.1",
"flow-bin": "0.43.1",
Expand Down Expand Up @@ -105,7 +112,6 @@
"react-transform-hmr": "^1.0.4",
"sass-loader": "^6.0.3",
"standard": "^10.0.1",
"standard-loader": "^6.0.1",
"style-loader": "^0.16.1",
"template-directory": "^2.0.0",
"url-loader": "^0.5.8",
Expand Down
19 changes: 19 additions & 0 deletions src/configure-webpack/loaders/javascript-eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": [
"standard",
"standard-jsx",
"prettier",
"prettier/react"
],
"plugins": [
"flowtype",
"import",
"react",
"standard"
],
"env":{
"jasmine": true,
"browser": true,
"es6": true
}
}
11 changes: 3 additions & 8 deletions src/configure-webpack/loaders/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,11 @@ export default {
{
test: fileExtensions.test.JAVASCRIPT,
enforce: 'pre',
loader: 'standard-loader',
loader: 'eslint-loader',
exclude: /node_modules/,
options: {
env: {
jasmine: true
},
error: action !== actions.DEVELOP && action !== actions.TEST_UNIT,
parser: 'babel-eslint',
plugins: ['flowtype'],
snazzy: true
configFile: path.join(__dirname, 'javascript-eslintrc.json'),
useEslintrc: false
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/configure-webpack/loaders/javascript.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import loader from './javascript'
describe('javaScript', () => {
const projectPath = '/tmp/test-project'

it('should lint the code by using standard', () => {
it('should lint the code by using eslint', () => {
const projectPath = 'a/demo/path'
const webpack = loader.configure({ projectPath })

expect(webpack.module.rules[0].loader).to.eql('standard-loader')
expect(webpack.module.rules[0].loader).to.eql('eslint-loader')
expect(webpack.module.rules[0].enforce).to.eql('pre')
})

Expand Down

0 comments on commit d5ca200

Please sign in to comment.