Skip to content

Commit 5c32804

Browse files
committed
Sneak in loads of linting between releases
1 parent 79c7800 commit 5c32804

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+523
-523
lines changed

gulpfile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
'use strict';
1+
"use strict";
22

3-
const fs = require('fs');
4-
const path = require('path');
5-
const gulp = require('gulp');
3+
const fs = require("fs");
4+
const path = require("path");
5+
const gulp = require("gulp");
66

77
// Pull configuration from the package.json:
88
// const {componentPath, componentDirectories, buildDestionation} = require('../vf-config');
@@ -14,4 +14,4 @@ const gulp = require('gulp');
1414
// Not familiar with JS Modules? Don't fret, it can be a lot like wrapping code in a function; here's
1515
// a nice quick start: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#Exporting_module_features
1616
// require('./gulp-tasks/_gulp_rollup.js')(gulp, path, componentPath, componentDirectories, buildDestionation);
17-
require(path.resolve('.', __dirname + '/node_modules/@visual-framework/vf-component-generator/gulp-tasks/vf-generator.js'))(gulp, path);
17+
require(path.resolve(".", __dirname + "/node_modules/@visual-framework/vf-component-generator/gulp-tasks/vf-generator.js"))(gulp, path);

tools/vf-component-generator/gulp-tasks/vf-generator.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
'use strict';
1+
"use strict";
22

33
/**
44
* Expose vf-component gulp task as a JS module
55
* This makes dependency management a bit cleaner
66
*/
77

88
module.exports = function(gulp, path) {
9-
const shell = require('gulp-shell');
9+
const shell = require("gulp-shell");
1010

11-
const generatorPath = path.resolve(__dirname, '..');
11+
const generatorPath = path.resolve(__dirname, "..");
1212

13-
gulp.task('vf-component', shell.task(
14-
['yo ' + generatorPath]
13+
gulp.task("vf-component", shell.task(
14+
["yo " + generatorPath]
1515
));
1616

1717
return gulp;
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
'use strict';
1+
"use strict";
22

3-
const fs = require('fs');
4-
const path = require('path');
5-
const gulp = require('gulp');
3+
const fs = require("fs");
4+
const path = require("path");
5+
const gulp = require("gulp");
66

77
// Pull configuration from the package.json:
88
// const {componentPath, componentDirectories, buildDestionation} = require('../vf-config');
@@ -14,4 +14,4 @@ const gulp = require('gulp');
1414
// Not familiar with JS Modules? Don't fret, it can be a lot like wrapping code in a function; here's
1515
// a nice quick start: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#Exporting_module_features
1616
// require('./gulp-tasks/_gulp_rollup.js')(gulp, path, componentPath, componentDirectories, buildDestionation);
17-
require(path.resolve('.', __dirname + '/gulp-tasks/vf-generator.js'))(gulp, path);
17+
require(path.resolve(".", __dirname + "/gulp-tasks/vf-generator.js"))(gulp, path);

tools/vf-component-generator/index.js

+63-63
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
var Generator = require('yeoman-generator');
2-
var chalk = require('chalk');
3-
var yosay = require('yosay');
4-
var path = require('path');
5-
var config = require(path.resolve('.','package.json'));
1+
var Generator = require("yeoman-generator");
2+
var chalk = require("chalk");
3+
var yosay = require("yosay");
4+
var path = require("path");
5+
var config = require(path.resolve(".","package.json"));
66

77
config.vfConfig = config.vfConfig || [];
88
vfName = config.vfConfig.vfName || "Visual Framework 2.0";
99
vfNamespace = config.vfConfig.vfNamespace || "vf-";
10-
vfComponentPath = config.vfConfig.vfComponentPath || path.resolve(__dirname, '../../components');
10+
vfComponentPath = config.vfConfig.vfComponentPath || path.resolve(__dirname, "../../components");
1111

1212
function camelize(str,upperCaseFirst) {
1313
var upperCaseFirst = upperCaseFirst || false;
@@ -17,26 +17,26 @@ function camelize(str,upperCaseFirst) {
1717
} else {
1818
return index === 0 ? word.toLowerCase() : word.toUpperCase();
1919
}
20-
}).replace(/\s+/g, '').replace(/-/g, '');
20+
}).replace(/\s+/g, "").replace(/-/g, "");
2121
}
2222

2323
module.exports = class extends Generator {
2424
prompting() {
2525
this.log((
26-
chalk.blue.bold("_______ _______ __ __ _______ _______ __ _ _______ __ _ _______ \n") +
27-
chalk.blue.bold("| || || |_| || || || | | || || | | || | \n") +
28-
chalk.blue.bold("| || _ || || _ || _ || |_| || ___|| |_| ||_ _| \n") +
29-
chalk.blue.bold("| || | | || || |_| || | | || || |___ | | | | \n") +
30-
chalk.blue.bold("| _|| |_| || || ___|| |_| || _ || ___|| _ | | | \n") +
31-
chalk.blue.bold("| |_ | || ||_|| || | | || | | || |___ | | | | | | \n") +
32-
chalk.blue.bold("|_______||_______||_| |_||___| |_______||_| |__||_______||_| |__| |___| \n") +
33-
chalk.red.bold("_______ _______ __ _ _______ ______ _______ _______ _______ ______ \n") +
34-
chalk.red.bold("| || || | | || || _ | | _ || || || _ | \n") +
35-
chalk.red.bold("| ___|| ___|| |_| || ___|| | || | |_| ||_ _|| _ || | || \n") +
36-
chalk.red.bold("| | __ | |___ | || |___ | |_||_ | | | | | | | || |_||_ \n") +
37-
chalk.red.bold("| || || ___|| _ || ___|| __ || | | | | |_| || __ |\n") +
38-
chalk.red.bold("| |_| || |___ | | | || |___ | | | || _ | | | | || | | |\n") +
39-
chalk.red.bold("|_______||_______||_| |__||_______||___| |_||__| |__| |___| |_______||___| |_|\n")
26+
chalk.blue.bold("_______ _______ __ __ _______ _______ __ _ _______ __ _ _______ \n") +
27+
chalk.blue.bold("| || || |_| || || || | | || || | | || | \n") +
28+
chalk.blue.bold("| || _ || || _ || _ || |_| || ___|| |_| ||_ _| \n") +
29+
chalk.blue.bold("| || | | || || |_| || | | || || |___ | | | | \n") +
30+
chalk.blue.bold("| _|| |_| || || ___|| |_| || _ || ___|| _ | | | \n") +
31+
chalk.blue.bold("| |_ | || ||_|| || | | || | | || |___ | | | | | | \n") +
32+
chalk.blue.bold("|_______||_______||_| |_||___| |_______||_| |__||_______||_| |__| |___| \n") +
33+
chalk.red.bold("_______ _______ __ _ _______ ______ _______ _______ _______ ______ \n") +
34+
chalk.red.bold("| || || | | || || _ | | _ || || || _ | \n") +
35+
chalk.red.bold("| ___|| ___|| |_| || ___|| | || | |_| ||_ _|| _ || | || \n") +
36+
chalk.red.bold("| | __ | |___ | || |___ | |_||_ | | | | | | | || |_||_ \n") +
37+
chalk.red.bold("| || || ___|| _ || ___|| __ || | | | | |_| || __ |\n") +
38+
chalk.red.bold("| |_| || |___ | | | || |___ | | | || _ | | | | || | | |\n") +
39+
chalk.red.bold("|_______||_______||_| |__||_______||___| |_||__| |__| |___| |_______||___| |_|\n")
4040
));
4141

4242
this.log((
@@ -45,35 +45,35 @@ module.exports = class extends Generator {
4545
chalk.white("https://stable.visual-framework.dev/developing/#components")
4646
));
4747

48-
var componentType = ['element', 'block', 'container', 'layout', 'utility'];
49-
if (vfNamespace != 'vf-') {
50-
var DepartmentType = [vfName, 'VF Global'];
48+
var componentType = ["element", "block", "container", "layout", "utility"];
49+
if (vfNamespace != "vf-") {
50+
var DepartmentType = [vfName, "VF Global"];
5151
} else {
5252
var DepartmentType = [vfName];
5353
}
5454

5555
var prompts = [{
56-
type: 'list',
57-
name: 'dept',
56+
type: "list",
57+
name: "dept",
5858
required: true,
59-
message: 'Who\'s the component for?',
59+
message: "Who's the component for?",
6060
choices: DepartmentType
6161
}, {
62-
type: 'list',
63-
name: 'type',
62+
type: "list",
63+
name: "type",
6464
required: true,
65-
message: 'What type of component is this?',
65+
message: "What type of component is this?",
6666
choices: componentType
6767
}, {
68-
type: 'input',
69-
name: 'componentName',
68+
type: "input",
69+
name: "componentName",
7070
required: true,
71-
message: 'What\'s the name of your component? (all lowercase, a hyphen instead of space, will be prefixed with your project\'s namespace.)',
72-
description: 'Component name'
71+
message: "What's the name of your component? (all lowercase, a hyphen instead of space, will be prefixed with your project's namespace.)",
72+
description: "Component name"
7373
}, {
74-
type: 'confirm',
75-
name: 'npm',
76-
message: 'Will this be published to npm?',
74+
type: "confirm",
75+
name: "npm",
76+
message: "Will this be published to npm?",
7777
default: true
7878
}];
7979

@@ -85,68 +85,68 @@ module.exports = class extends Generator {
8585
writing() {
8686

8787
switch (this.props.dept) {
88-
case vfName:
88+
case vfName:
8989
var namespace = vfNamespace;
9090
break;
91-
case "VF Global":
91+
case "VF Global":
9292
var namespace = "vf-";
9393
break;
9494
}
9595
var patternType = this.props.type;
96-
var totalPath = vfComponentPath + '/' + namespace + this.props.componentName + "/";
96+
var totalPath = vfComponentPath + "/" + namespace + this.props.componentName + "/";
9797
var fileName = namespace + this.props.componentName;
9898

99-
var outputFile = fileName + '.njk';
99+
var outputFile = fileName + ".njk";
100100
this.fs.copyTpl(
101-
this.templatePath('_component.njk'),
101+
this.templatePath("_component.njk"),
102102
this.destinationPath(totalPath + outputFile),
103103
{
104104
componentName: fileName
105105
}
106106
);
107107

108-
var outputFile = fileName + '.scss';
108+
var outputFile = fileName + ".scss";
109109
this.fs.copyTpl(
110-
this.templatePath('_component.scss'),
110+
this.templatePath("_component.scss"),
111111
this.destinationPath(totalPath + outputFile),
112112
{
113113
isNpmComponent: this.props.npm,
114114
componentName: fileName
115115
}
116116
);
117117

118-
var outputFile = fileName + '.variables.scss';
118+
var outputFile = fileName + ".variables.scss";
119119
this.fs.copyTpl(
120-
this.templatePath('_component.variables.scss'),
120+
this.templatePath("_component.variables.scss"),
121121
this.destinationPath(totalPath + outputFile),
122122
{
123123
componentName: fileName
124124
}
125125
);
126126

127-
var outputFile = fileName + '.js';
127+
var outputFile = fileName + ".js";
128128
this.fs.copyTpl(
129-
this.templatePath('_component.js'),
129+
this.templatePath("_component.js"),
130130
this.destinationPath(totalPath + outputFile),
131131
{
132132
componentNameJs: camelize(fileName), // JS friendly name
133133
componentName: fileName
134134
}
135135
);
136136

137-
var outputFile = fileName + '.react.js';
137+
var outputFile = fileName + ".react.js";
138138
this.fs.copyTpl(
139-
this.templatePath('_component.react.js'),
139+
this.templatePath("_component.react.js"),
140140
this.destinationPath(totalPath + outputFile),
141141
{
142142
componentNameReact: camelize(fileName, true), // React JS friendly name
143143
componentName: fileName
144144
}
145145
);
146146

147-
var outputFile = fileName + '.config.yml';
147+
var outputFile = fileName + ".config.yml";
148148
this.fs.copyTpl(
149-
this.templatePath('_component.config.yml'),
149+
this.templatePath("_component.config.yml"),
150150
this.destinationPath(totalPath + outputFile),
151151
{
152152
componentType: patternType,
@@ -155,45 +155,45 @@ module.exports = class extends Generator {
155155
);
156156

157157
this.fs.copyTpl(
158-
this.templatePath('_README.md'),
159-
this.destinationPath(totalPath + 'README.md'),
158+
this.templatePath("_README.md"),
159+
this.destinationPath(totalPath + "README.md"),
160160
{
161161
componentName: fileName
162162
}
163163
);
164164

165165
this.fs.copyTpl(
166-
this.templatePath('_.npmignore'),
167-
this.destinationPath(totalPath + '.npmignore'),
166+
this.templatePath("_.npmignore"),
167+
this.destinationPath(totalPath + ".npmignore"),
168168
{
169169
componentName: fileName
170170
}
171171
);
172172

173173
this.fs.copyTpl(
174-
this.templatePath('_CHANGELOG.md'),
175-
this.destinationPath(totalPath + 'CHANGELOG.md'),
174+
this.templatePath("_CHANGELOG.md"),
175+
this.destinationPath(totalPath + "CHANGELOG.md"),
176176
{
177177
componentName: fileName
178178
}
179179
);
180180

181181
if (this.props.npm) {
182182
this.fs.copyTpl(
183-
this.templatePath('_package.json'),
184-
this.destinationPath(totalPath + 'package.json'),
183+
this.templatePath("_package.json"),
184+
this.destinationPath(totalPath + "package.json"),
185185
{
186186
componentName: fileName,
187187
componentHomepage: config.vfConfig.vfHomepage,
188-
componentStylesheet: fileName + '.scss'
188+
componentStylesheet: fileName + ".scss"
189189
}
190190
);
191191
}
192192

193193
if (this.props.npm) {
194194
this.fs.copyTpl(
195-
this.templatePath('_index.scss'),
196-
this.destinationPath(totalPath + 'index.scss'),
195+
this.templatePath("_index.scss"),
196+
this.destinationPath(totalPath + "index.scss"),
197197
{
198198
componentName: fileName
199199
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
'use strict';
1+
"use strict";

tools/vf-component-library/eleventy.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { DateTime } = require('luxon');
2-
const _ = require('lodash');
3-
const Path = require('path');
1+
const { DateTime } = require("luxon");
2+
const _ = require("lodash");
3+
const Path = require("path");
44

55
module.exports = function(config) {
66

@@ -22,7 +22,7 @@ module.exports = function(config) {
2222
// return 'ddd' + value;
2323
// });
2424

25-
// Add any utiliuty filters
25+
// Add any utility filters
2626
config.addFilter("dateDisplay", (dateObj, format = "d LLL y") => {
2727
return DateTime.fromJSDate(dateObj, {
2828
zone: "utc"
@@ -33,12 +33,12 @@ module.exports = function(config) {
3333
// {{ 'string words' | camelize(true) }}
3434
config.addFilter("camelize", (str, upperCaseFirst = false) => {
3535
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
36-
if (upperCaseFirst) {
36+
if (upperCaseFirst) {
3737
return word.toUpperCase();
3838
} else {
3939
return index === 0 ? word.toLowerCase() : word.toUpperCase();
4040
}
41-
}).replace(/\s+/g, '').replace('-', '');
41+
}).replace(/\s+/g, "").replace("-", "");
4242
});
4343

4444
// Split filter support

tools/vf-component-library/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
'use strict';
1+
"use strict";
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-breakpoints.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-breakpoints.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-colors.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-colors.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-color__neutral.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-color__neutral.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-spacing.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-spacing.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-color__brand.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-color__brand.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-color__buttons.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-color__buttons.ios.json"));
33
module.exports = pkg;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
2-
const pkg = require(path.join(process.cwd(), '../../components/vf-design-tokens/dist/json/vf-color__text.ios.json'));
1+
const path = require("path");
2+
const pkg = require(path.join(process.cwd(), "../../components/vf-design-tokens/dist/json/vf-color__text.ios.json"));
33
module.exports = pkg;

0 commit comments

Comments
 (0)