Skip to content

Commit

Permalink
Split out .babelrc and .eslintrc files, add in linting for vue compon…
Browse files Browse the repository at this point in the history
…ents using vue-eslint-parser, cry at the amount of errors...
  • Loading branch information
overshard committed Jun 29, 2018
1 parent d77c134 commit ac94829
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 208 deletions.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
"env",
"react",
"stage-0"
],
"plugins": [
"transform-class-properties",
"transform-decorators",
"transform-react-constant-elements",
"transform-react-inline-elements"
]
}
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"rules": {
"indent": ["error", 4],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"]
},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
"parser": "vue-eslint-parser",
"extends": [
"plugin:vue/recommended",
"eslint:recommended"
],
"plugins": [
"vue"
],
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 6,
"sourceType": "module"
}
}
64 changes: 13 additions & 51 deletions gulpfile.js/tasks/linting.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,23 +25,18 @@ gulp.task('lint:python', function(cb) {




gulp.task('lint:sass', function() { gulp.task('lint:sass', function() {
return gulp.src('static_src/sass/**/*.{scss|sass|css}') // return gulp.src('client/static_src/components/**/*.vue')
.pipe(sasslint({ // .pipe(sasslint({
rules: { // rules: {
'no-vendor-prefixes': 2, // 'no-vendor-prefixes': 2,
'no-ids': 0, // 'no-ids': 0,
'indentation': [ // 'indentation': [1, {'size': 4}],
1, // 'property-sort-order': 0,
{ // 'force-element-nesting': 0,
'size': 4 // },
} // }))
], // .pipe(sasslint.format())
'property-sort-order': 0, // .pipe(sasslint.failOnError());
'force-element-nesting': 0
}
}))
.pipe(sasslint.format())
.pipe(sasslint.failOnError());
}); });




Expand All @@ -50,40 +45,7 @@ gulp.task('lint:es', function() {
'gulpfile.js/**/*.js', 'gulpfile.js/**/*.js',
'client/static_src/**/*.js', 'client/static_src/**/*.js',
'client/static_src/components/**/*.vue']) 'client/static_src/components/**/*.vue'])
.pipe(eslint({ .pipe(eslint())
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
]
},
'globals': [
'$'
],
'env': {
'browser': true
},
'extends': 'eslint:recommended',
'plugins': [
'html'
],
'parserOptions': {
'ecmaVersion': 6,
'sourceType': 'module'
}
}))
.pipe(eslint.format()) .pipe(eslint.format())
.pipe(eslint.failAfterError()); .pipe(eslint.failAfterError());
}); });
Loading

0 comments on commit ac94829

Please sign in to comment.