Skip to content

Commit

Permalink
Remove sayHello.js from libs, remove css-mqpacker, add `no-unused…
Browse files Browse the repository at this point in the history
…-expressions` linter rule
  • Loading branch information
yurayarosh committed May 15, 2020
1 parent 611966d commit c6e4a86
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 82 deletions.
26 changes: 0 additions & 26 deletions generators/app/templates/gulp/tasks/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,13 @@ import sass from 'gulp-sass'
import sourcemaps from 'gulp-sourcemaps'
import postcss from 'gulp-postcss'
import autoprefixer from 'autoprefixer'
import mqpacker from 'css-mqpacker'
import csso from 'postcss-csso'
import { src, dest, production, errorHandler } from '../config'

const isMax = mq => /max-width/.test(mq)
const isMin = mq => /min-width/.test(mq)

const sortMediaQueries = (a, b) => {
const A = a.replace(/\D/g, '')
const B = b.replace(/\D/g, '')

if (isMax(a) && isMax(b)) {
return B - A
}
if (isMin(a) && isMin(b)) {
return A - B
}
if (isMax(a) && isMin(b)) {
return 1
}
if (isMin(a) && isMax(b)) {
return -1
}
return 1
}

const processors = [
autoprefixer({
cascade: false,
}),
mqpacker({
sort: sortMediaQueries,
}),
csso,
]

Expand Down
15 changes: 10 additions & 5 deletions generators/app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@
"plugin:prettier/recommended"
],
"rules": {
"no-unused-vars": 1,
"class-methods-use-this": 0,
"no-underscore-dangle": 0,
"no-param-reassign": 0,
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"no-unused-vars": 1,
"class-methods-use-this": 0,
"no-underscore-dangle": 0,
"no-param-reassign": 0
"no-unused-expressions": [
"error",
{
"allowTernary": true
}
]
}
},
"babel": {
Expand Down Expand Up @@ -69,7 +75,6 @@
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"browser-sync": "^2.26.7",
"css-mqpacker": "^7.0.0",
"del": "^5.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
Expand Down
1 change: 0 additions & 1 deletion generators/app/templates/src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class App {
}

toggleScroll(condition) {
// eslint-disable-next-line
condition ? this.preventScroll() : this.allowScroll()
}
}
Expand Down
49 changes: 0 additions & 49 deletions generators/app/templates/src/js/lib/sayHello.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-front-starter-kit",
"version": "1.1.3",
"version": "1.1.4",
"description": "Starter-kit for HTML, CSS, JS projects Generator.",
"files": [
"generators"
Expand Down

0 comments on commit c6e4a86

Please sign in to comment.