Skip to content

Commit

Permalink
GHI-#8 Rewrite gulp tasks for new JSON theme format
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed May 2, 2017
1 parent debe5dd commit c9ac86a
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ++++++++++++++++++++++
# +--------------------+
# + Base Configuration +
# ++++++++++++++++++++++
# +--------------------+
[*]
charset = utf-8
end_of_line = lf
Expand All @@ -10,9 +10,9 @@ insert_final_newline = true
max_line_length = 160
trim_trailing_whitespace = true

# +++++++++++++
# +-----------+
# + Languages +
# +++++++++++++
# +++ Markdown +++
# +-----------+
# +--- Markdown ---+
[*.{md,gfm}]
trim_trailing_whitespace = false
78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title ESLint Configuration +
project nord-visual-studio-code +
repository https://github.com/arcticicestudio/nord-visual-studio-code +
author Arctic Ice Studio +
email development@arcticicestudio.com +
copyright Copyright (C) 2017 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[References]
ESLint
http://eslint.org/docs/rules
http://eslint.org/docs/user-guide/configuring
http://eslint.org/docs/user-guide/configuring#using-configuration-files
http://eslint.org/docs/user-guide/configuring#specifying-environments
http://eslint.org/docs/user-guide/configuring.html#specifying-globals
*/
module.exports = {
"env": {
"node": true,
"es6": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {}
},
"plugins": [
"json"
],
"extends": [
"eslint:recommended"
],
"rules": {
// Style Guide
"array-bracket-spacing": ["error", "never"],
"comma-dangle": ["error", "never"],
"curly":["error", "all"],
"func-call-spacing": ["error", "never"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"no-duplicate-imports": "error",
"no-floating-decimal": "error",
"no-tabs": "error",
"no-trailing-spaces": ["error", {
"skipBlankLines": false
}],
"no-var": "error",
"no-whitespace-before-property": "error",
"quotes": ["error", "double"],
"semi": ["error", "always"],
// Error Prevention
"no-cond-assign": ["error", "always"],
"no-console": "off",
// Code Performance
"global-require": "warn",
// Documentation
"require-jsdoc": ["warn", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": true,
"ArrowFunctionExpression": false
}
}],
"valid-jsdoc": ["error", {
"prefer": {
"arg": "param",
"argument": "param",
"class": "constructor",
"virtual": "abstract"
},
"requireParamDescription": true,
"requireReturnDescription": true
}]
}
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
30 changes: 19 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/*
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Project Gulp File +
Expand All @@ -10,22 +11,20 @@ copyright Copyright (C) 2017 +
[References]
Gulp
(http://gulpjs.com)
http://gulpjs.com
npmjs
(https://www.npmjs.com)
https://www.npmjs.com
*/

"use strict";
/*+---------+
+ Imports +
+---------+*/
const gulp = require("gulp-help")(require("gulp"));
const xmlValidator = require("gulp-xml-validator");
const eslint = require("gulp-eslint");

/*+---------------+
+ Configuration +
+---------------+*/
const tmThemeFiles = ["themes/*.tmTheme"];
const jsonThemeFiles = ["themes/**/*.json"];

/*+-------+
+ Tasks +
Expand All @@ -38,11 +37,20 @@ const tmThemeFiles = ["themes/*.tmTheme"];
gulp.task("default", ["help"]);

/**
* Lints all color theme files.
* Runs all lint tasks.
*
* @since 0.1.0
* @since 0.2.0
*/
gulp.task("lint", "Runs all lint tasks", ["lint-json"]);

/**
* Lints all JSON color theme sources.
*
* @since 0.2.0
*/
gulp.task('lint', "Lints all color theme files", () => {
return gulp.src(tmThemeFiles)
.pipe(xmlValidator());
gulp.task("lint-json", "Lints all JSON color theme sources", () => {
return gulp.src(jsonThemeFiles)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
]
},
"devDependencies": {
"eslint": "3.19.0",
"eslint-plugin-json": "1.2.0",
"gulp": "3.9.1",
"gulp-help": "1.6.1",
"gulp-xml-validator": "0.1.2"
"gulp-eslint": "3.0.1",
"gulp-help": "1.6.1"
}
}

0 comments on commit c9ac86a

Please sign in to comment.