Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
import eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanobartoletti committed Sep 6, 2021
1 parent f8c55d1 commit 4efe905
Show file tree
Hide file tree
Showing 4 changed files with 895 additions and 25 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true
},
parser: '@babel/eslint-parser',
extends: [
'standard'
],
rules: {
'no-unused-vars': ['warn'],
semi: ['error', 'always']
}
};
16 changes: 8 additions & 8 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function clean() {

// --- Browser ---

function browser_sync(done) {
function bsInit(done) {
browserSync.init({
open: false,
injectChanges: true,
Expand All @@ -194,7 +194,7 @@ function browser_sync(done) {
done();
};

function reload(done) {
function bsReload(done) {
browserSync.reload();
done();
};
Expand All @@ -205,11 +205,11 @@ function clearCache(done) {
};

function watchFiles(done) {
watch(config.css.watch, series(css, clearCache, reload));
watch(config.js.watch, series(js, clearCache, reload));
watch(config.php.watch, series(clearCache, reload));
watch(config.img.watch, series(img, clearCache, reload));
watch(config.fonts.watch, series(fonts, clearCache, reload));
watch(config.css.watch, series(css, clearCache, bsReload));
watch(config.js.watch, series(js, clearCache, bsReload));
watch(config.php.watch, series(clearCache, bsReload));
watch(config.img.watch, series(img, clearCache, bsReload));
watch(config.fonts.watch, series(fonts, clearCache, bsReload));
done();
};

Expand All @@ -219,7 +219,7 @@ function watchFiles(done) {
const i18n = series(domain, pot);
const dev = series(setDev, clean, parallel(css, js, img, fonts, icons));
const build = series(setProd, clean, parallel(css, js, img, fonts, icons, i18n));
const watcher = parallel(browser_sync, watchFiles);
const watcher = parallel(bsInit, watchFiles);

export { css, js, img, fonts, icons, i18n, dev, build, watcher as watch };
export default dev;
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"scripts": {
"dev": "gulp default",
"build": "gulp build",
"watch": "gulp watch"
"watch": "gulp watch",
"lint:js": "eslint --ext js,mjs --fix --ignore-path .gitignore ."
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
Expand All @@ -19,6 +20,7 @@
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.4",
"@babel/preset-env": "^7.15.4",
"@mr-hope/gulp-sass": "^2.0.0",
"@rbnlffl/gulp-rollup": "^0.1.1",
Expand All @@ -27,6 +29,11 @@
"@rollup/plugin-node-resolve": "^13.0.4",
"browser-sync": "^2.27.5",
"del": "^6.0.0",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-cache": "^1.1.3",
Expand Down
Loading

0 comments on commit 4efe905

Please sign in to comment.