Skip to content

Commit

Permalink
fix(gulp): Fail lint task on error
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Mar 7, 2019
1 parent 085b6c5 commit c56a848
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
13 changes: 11 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
},
"root": true,
"rules": {
"comma-dangle": [
"warn",
"only-multiline",
],
// "indent": [
// "error",
// "tab",
Expand All @@ -34,7 +38,6 @@
"warn",
{
"args": "none",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
}
],
Expand All @@ -61,7 +64,13 @@
},
"parserOptions": {
"ecmaVersion": 2015,
}
},
"rules": {
"comma-dangle": [
"error",
"always-multiline",
],
},
},
{
"files": [
Expand Down
3 changes: 2 additions & 1 deletion code.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ $$('[data-src][data-type="text/html"]').forEach(function(element) {
// Run JS

$$('script', element).forEach(function (script) {
var after = script.nextSibling, parent = script.parentNode;
var _after = script.nextSibling,
parent = script.parentNode;
parent.removeChild(script);
document.head.appendChild(script);
});
Expand Down
13 changes: 7 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ const paths = {
'components/prism-css.js',
'components/prism-clike.js',
'components/prism-javascript.js',
'plugins/file-highlight/prism-file-highlight.js'
'plugins/file-highlight/prism-file-highlight.js',
],
plugins: ['plugins/**/*.js', '!plugins/**/*.min.js'],
showLanguagePlugin: 'plugins/show-language/prism-show-language.js',
autoloaderPlugin: 'plugins/autoloader/prism-autoloader.js',
changelog: 'CHANGELOG.md'
changelog: 'CHANGELOG.md',
};

const componentsPromise = new Promise((resolve, reject) => {
fs.readFile(paths.componentsFile, {
encoding: 'utf-8'
encoding: 'utf-8',
}, (err, data) => {
if (!err) {
resolve(JSON.parse(data));
Expand Down Expand Up @@ -58,7 +58,7 @@ function inlineRegexSource() {
function minifyJS() {
return [
inlineRegexSource(),
uglify()
uglify(),
];
}

Expand All @@ -67,6 +67,7 @@ function lint(cb) {
src(['**/*.js', '!node_modules/**'], { base: './' }),
eslint(),
eslint.format(),
eslint.failAfterError(),
], cb);
}

Expand Down Expand Up @@ -155,7 +156,7 @@ function languagePlugins(cb) {

const tasks = [
{ plugin: paths.showLanguagePlugin, map: jsonLanguagesMap },
{ plugin: paths.autoloaderPlugin, map: jsonDependenciesMap }
{ plugin: paths.autoloaderPlugin, map: jsonDependenciesMap },
];

let cpt = 0;
Expand Down Expand Up @@ -192,7 +193,7 @@ function changelog(cb) {
/\[[\da-f]+(?:, *[\da-f]+)*\]/g,
m => m.replace(/([\da-f]{7})[\da-f]*/g, '[`$1`](https://github.com/PrismJS/prism/commit/$1)')
),
dest('.')
dest('.'),
], cb);
}

Expand Down

0 comments on commit c56a848

Please sign in to comment.