mod-build 3.6.91 → 3.6.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.yml +38 -48
- package/CHANGELOG.md +5 -0
- package/gulp-tasks/add-editorconfig.js +22 -0
- package/gulp-tasks/js-lint.js +6 -4
- package/gulp-tasks/serve.js +3 -3
- package/gulp-tasks/tasks.js +12 -0
- package/package.json +7 -3
package/.eslintrc.yml
CHANGED
|
@@ -1,59 +1,49 @@
|
|
|
1
1
|
parserOptions:
|
|
2
|
-
ecmaVersion:
|
|
2
|
+
ecmaVersion: 'latest'
|
|
3
3
|
sourceType: 'module'
|
|
4
|
+
|
|
4
5
|
env:
|
|
5
6
|
browser: true
|
|
6
7
|
jquery: true
|
|
8
|
+
node: true
|
|
9
|
+
|
|
10
|
+
extends: 'eslint:recommended'
|
|
7
11
|
|
|
8
12
|
globals:
|
|
9
13
|
require: true
|
|
10
14
|
module: true
|
|
11
15
|
|
|
12
|
-
rules:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
comma-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
rules: {
|
|
17
|
+
brace-style: [2, '1tbs'],
|
|
18
|
+
camelcase: 2,
|
|
19
|
+
comma-dangle: [2, 'never'],
|
|
20
|
+
comma-style: [2, 'last'],
|
|
21
|
+
curly: [2, 'all'],
|
|
22
|
+
default-case: 2,
|
|
23
|
+
dot-notation: 2,
|
|
24
|
+
eqeqeq: [2, 'always', {'null': 'ignore'}],
|
|
25
|
+
guard-for-in: 2,
|
|
26
|
+
indent: [2, 'tab'],
|
|
27
|
+
key-spacing: [2, {beforeColon: false, afterColon: true, mode: 'minimum'}],
|
|
28
|
+
keyword-spacing: [2, { before: true, after: true }],
|
|
29
|
+
new-cap: 2,
|
|
30
|
+
no-console: 0,
|
|
31
|
+
no-floating-decimal: 2,
|
|
32
|
+
no-nested-ternary: 2,
|
|
33
|
+
no-new: 2,
|
|
34
|
+
no-shadow: 2,
|
|
35
|
+
no-use-before-define: 2,
|
|
36
|
+
operator-linebreak: [2, 'before', {overrides: {'?': 'after', ':': 'after'}}],
|
|
37
|
+
prefer-const: 2,
|
|
38
|
+
quotes: [2, 'single'],
|
|
39
|
+
semi: 2,
|
|
40
|
+
semi-spacing: 2,
|
|
41
|
+
space-before-blocks: [2, 'always'],
|
|
42
|
+
space-before-function-paren: [2, 'never'],
|
|
43
|
+
spaced-comment: [2, 'always', { exceptions: ['-']}],
|
|
44
|
+
space-infix-ops: 2,
|
|
45
|
+
space-in-parens: [2, 'never'],
|
|
46
|
+
strict: [2, 'never'],
|
|
47
|
+
valid-jsdoc: [2, { requireReturn: false, prefer: { return: "returns" }}],
|
|
25
48
|
wrap-iife: [2, "inside", { functionPrototypeMethods: true }]
|
|
26
|
-
|
|
27
|
-
strict: [2, "never"]
|
|
28
|
-
camelcase: 1
|
|
29
|
-
curly: [2, "all"]
|
|
30
|
-
eqeqeq: [2, "allow-null"]
|
|
31
|
-
no-empty: 2
|
|
32
|
-
no-use-before-define: 2
|
|
33
|
-
no-obj-calls: 2
|
|
34
|
-
no-unused-vars: [1, {vars: "local", args: "after-used"}]
|
|
35
|
-
new-cap: 2
|
|
36
|
-
no-shadow: 1
|
|
37
|
-
no-invalid-regexp: 2
|
|
38
|
-
comma-dangle: [1, "never"]
|
|
39
|
-
no-undef: 2
|
|
40
|
-
no-new: 2
|
|
41
|
-
no-extra-semi: 2
|
|
42
|
-
no-debugger: 2
|
|
43
|
-
no-caller: 1
|
|
44
|
-
semi: 2
|
|
45
|
-
quotes: [1, "single", "avoid-escape"]
|
|
46
|
-
no-unreachable: 2
|
|
47
|
-
eol-last: 1
|
|
48
|
-
operator-linebreak: [1, "before", {overrides: {"?": "after", ":": "after"}}]
|
|
49
|
-
no-multi-str: 1
|
|
50
|
-
no-mixed-spaces-and-tabs: 1
|
|
51
|
-
no-trailing-spaces: 1
|
|
52
|
-
space-infix-ops: 1
|
|
53
|
-
space-unary-ops: 0
|
|
54
|
-
no-with: 2
|
|
55
|
-
dot-notation: 1
|
|
56
|
-
semi-spacing: 1
|
|
57
|
-
key-spacing: [1, {beforeColon: false, afterColon: true, mode: "minimum"}]
|
|
58
|
-
space-in-parens: [1, "never"]
|
|
59
|
-
prefer-const: 2
|
|
49
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.92
|
|
4
|
+
|
|
5
|
+
- Updating `.eslintrc.yml` with our new lint rules; This configuration will also live on `quote.modernize.com`
|
|
6
|
+
- Adding a new `add-editorconfig` task that will grab our global `editorconfig` file configuration & either add it to the project, or override the existing file contents
|
|
7
|
+
|
|
3
8
|
## 3.6.91
|
|
4
9
|
|
|
5
10
|
- Added support for xml files
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var request = require('request');
|
|
2
|
+
var source = require('vinyl-source-stream');
|
|
3
|
+
|
|
4
|
+
function addEditorConfig(gulp, siteSettings) {
|
|
5
|
+
return new Promise(resolve => {
|
|
6
|
+
request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/configurations/editorconfig`)
|
|
7
|
+
.on('response', resp => {
|
|
8
|
+
if (resp.statusCode !== 200) {
|
|
9
|
+
throw new Error(`${resp.statusCode} Error while fetching editorconfig`);
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
.pipe(source('.editorconfig'))
|
|
13
|
+
.pipe(gulp.dest('./'))
|
|
14
|
+
.on('finish', resolve);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = function(gulp, siteSettings) {
|
|
19
|
+
return function() {
|
|
20
|
+
addEditorConfig(gulp, siteSettings);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/gulp-tasks/js-lint.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
2
2
|
var fs = require('fs');
|
|
3
|
+
var gulpESLintNew = require('gulp-eslint-new');
|
|
3
4
|
|
|
4
5
|
// Default jsLint settings
|
|
5
6
|
if ('undefined' === typeof siteSettings.jsLint) {
|
|
6
7
|
siteSettings.jsLint = {
|
|
7
|
-
|
|
8
|
+
overrideConfigFile: './node_modules/mod-build/.eslintrc.yml'
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -17,8 +18,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
17
18
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/resources/**/*.js', // do not lint copied shared resource scripts,
|
|
18
19
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
|
|
19
20
|
])
|
|
20
|
-
.pipe(
|
|
21
|
-
.pipe(
|
|
22
|
-
.pipe(
|
|
21
|
+
.pipe(gulpESLintNew(siteSettings.jsLint))
|
|
22
|
+
.pipe(gulpESLintNew.format())
|
|
23
|
+
.pipe(gulpESLintNew.format('junit', fs.createWriteStream('eslint-results.xml')))
|
|
24
|
+
.pipe(gulpESLintNew.failAfterError());
|
|
23
25
|
};
|
|
24
26
|
};
|
package/gulp-tasks/serve.js
CHANGED
|
@@ -4,11 +4,11 @@ module.exports.src = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
4
4
|
var runSequence = require('run-sequence');
|
|
5
5
|
var sequenceOpts;
|
|
6
6
|
if (siteData.useTypescript) {
|
|
7
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
7
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
8
8
|
} else if (siteData.isQSPage) {
|
|
9
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
9
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
10
10
|
} else {
|
|
11
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images','grab-global-images', 'js-lint'];
|
|
11
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images','grab-global-images', 'js-lint'];
|
|
12
12
|
}
|
|
13
13
|
runSequence(...sequenceOpts, () => {
|
|
14
14
|
// Run a BrowserSync server
|
package/gulp-tasks/tasks.js
CHANGED
|
@@ -56,6 +56,18 @@ module.exports = function() {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
+
// Grab global editorconfig file and add to project or override existing file contents
|
|
60
|
+
'add-editorconfig': {
|
|
61
|
+
subtasks: [],
|
|
62
|
+
func: function(opts) {
|
|
63
|
+
if ('undefined' === typeof opts.gulpTasksFolderPath) {
|
|
64
|
+
opts.gulpTasksFolderPath = '.';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return require(opts.gulpTasksFolderPath + '/add-editorconfig')(opts.gulp, opts.gulpSettings);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
59
71
|
// Grab component files from CDN so they can be swapped into build
|
|
60
72
|
'grab-shared-components': {
|
|
61
73
|
subtasks: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-build",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.92",
|
|
4
4
|
"description": "Share components for S3 sites.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"bootstrap-sass": "^3.4.3",
|
|
16
16
|
"browser-sync": "^2.18.6",
|
|
17
17
|
"del": "^3.0.0",
|
|
18
|
+
"eslint": "^8.57.0",
|
|
18
19
|
"gulp": "^3.9.1",
|
|
19
20
|
"gulp-autoprefixer": "^3.1.1",
|
|
20
21
|
"gulp-babel": "^8.0.0",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"gulp-cssmin": "^0.1.7",
|
|
25
26
|
"gulp-csso": "^3.0.0",
|
|
26
27
|
"gulp-eslint": "^5.0.0",
|
|
28
|
+
"gulp-eslint-new": "^2.1.0",
|
|
27
29
|
"gulp-eslint-threshold": "^0.1.1",
|
|
28
30
|
"gulp-filter": "^5.0.0",
|
|
29
31
|
"gulp-handlebars-file-include": "^1.0.0",
|
|
@@ -66,7 +68,8 @@
|
|
|
66
68
|
"webpack-stream": "^5.2.1"
|
|
67
69
|
},
|
|
68
70
|
"resolutions": {
|
|
69
|
-
"graceful-fs": "4.2.3"
|
|
71
|
+
"graceful-fs": "4.2.3",
|
|
72
|
+
"eslint": "8.57.0"
|
|
70
73
|
},
|
|
71
74
|
"husky": {
|
|
72
75
|
"hooks": {
|
|
@@ -74,6 +77,7 @@
|
|
|
74
77
|
}
|
|
75
78
|
},
|
|
76
79
|
"overrides": {
|
|
77
|
-
"graceful-fs": "^4.2.9"
|
|
80
|
+
"graceful-fs": "^4.2.9",
|
|
81
|
+
"eslint": "8.57.0"
|
|
78
82
|
}
|
|
79
83
|
}
|