Skip to content

Commit 4db4ae4

Browse files
committed
run lint:fix
1 parent ab98bcd commit 4db4ae4

28 files changed

+214
-161
lines changed

.eslintrc.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,19 @@ module.exports = {
5656
},
5757
{
5858
// Node tests
59-
files: [
60-
'node-tests/**/*.js'
61-
],
59+
files: ['node-tests/**/*.js'],
6260
env: {
6361
node: true,
64-
mocha: true
62+
mocha: true,
6563
},
6664
parserOptions: {
67-
ecmaVersion: 2018
65+
ecmaVersion: 2018,
6866
},
6967
rules: {
70-
"func-names": 0,
71-
"prefer-arrow-callback": 0,
72-
"no-unused-expressions": 0
68+
'func-names': 0,
69+
'prefer-arrow-callback': 0,
70+
'no-unused-expressions': 0,
7371
},
74-
}
72+
},
7573
],
7674
};

.remarkrc.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
// .remarkrc.js
22
/* eslint-env node */
3-
const unified = require("unified");
4-
const read = require("fs").readFileSync;
5-
const ember = require("ember-dictionary");
3+
const unified = require('unified');
4+
const read = require('fs').readFileSync;
5+
const ember = require('ember-dictionary');
66

77
exports.plugins = [
88
[
9-
require("remark-retext"),
9+
require('remark-retext'),
1010
unified().use({
1111
plugins: [
12-
[require("retext-contractions"), { straight: true }],
13-
require("retext-english"),
14-
require("retext-indefinite-article"),
15-
require("retext-repeated-words"),
16-
require("retext-syntax-urls"),
12+
[require('retext-contractions'), { straight: true }],
13+
require('retext-english'),
14+
require('retext-indefinite-article'),
15+
require('retext-repeated-words'),
16+
require('retext-syntax-urls'),
1717
[
18-
require("retext-spell"),
18+
require('retext-spell'),
1919
{
2020
dictionary: ember,
21-
personal: read("./.local.dic")
22-
}
23-
]
24-
]
25-
})
21+
personal: read('./.local.dic'),
22+
},
23+
],
24+
],
25+
}),
2626
],
27-
"remark-preset-lint-consistent",
28-
"remark-preset-lint-recommended",
29-
["remark-lint-list-item-indent", "space"],
30-
["remark-lint-list-item-bullet-indent", false],
31-
["remark-lint-code-block-style", false]
27+
'remark-preset-lint-consistent',
28+
'remark-preset-lint-recommended',
29+
['remark-lint-list-item-indent', 'space'],
30+
['remark-lint-list-item-bullet-indent', false],
31+
['remark-lint-code-block-style', false],
3232
];

config/deploy.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ try {
99
credentials = {};
1010
}
1111

12-
module.exports = function(deployTarget) {
12+
module.exports = function (deployTarget) {
1313
let ENV = {
1414
build: {},
1515
'prember-algolia': {
1616
indexName: credentials.algoliaIndex || process.env.ALGOLIA_INDEX,
17-
applicationId: credentials.algoliaApplication || process.env.ALGOLIA_APPLICATION,
17+
applicationId:
18+
credentials.algoliaApplication || process.env.ALGOLIA_APPLICATION,
1819
apiKey: credentials.algoliaKey || process.env.ALGOLIA_KEY,
1920
tagsToExclude: '.old-version-warning,.edit-page,code,pre',
2021
cssSelector: 'section',
2122
versionsToIgnore: ['1.x', '2.x'],
2223
versionPattern: /^(v\d+\.\d+\.\d+)\//,
2324
pathPattern: /^v\d+\.\d+\.\d+\/(.*)\/index.html$/,
24-
}
25+
},
2526
};
2627

2728
if (deployTarget === 'development') {

config/environment.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@ module.exports = function (environment) {
2525
},
2626

2727
'ember-meta': {
28-
description: 'Ember.js helps developers be more productive out of the box. Designed with developer ergonomics in mind, its friendly APIs help you get your job done—fast.'
28+
description:
29+
'Ember.js helps developers be more productive out of the box. Designed with developer ergonomics in mind, its friendly APIs help you get your job done—fast.',
2930
},
3031

3132
guidemaker: {
3233
title: 'Ember Guides',
33-
sourceRepo: 'https://github.com/ember-learn/guides-source'
34+
sourceRepo: 'https://github.com/ember-learn/guides-source',
3435
},
3536

3637
algolia: {
3738
algoliaId: 'Y1OMR4C7MF',
3839
algoliaKey: '5d01c83734dc36754d9e94cbf6f8964d',
39-
indexName: 'ember-guides'
40+
indexName: 'ember-guides',
4041
},
4142

4243
showdown: {
4344
ghCompatibleHeaderId: true,
44-
prefixHeaderId: 'toc_'
45+
prefixHeaderId: 'toc_',
4546
},
4647

4748
deprecationsGuideURL: 'https://www.emberjs.com/deprecations/',
@@ -52,8 +53,8 @@ module.exports = function (environment) {
5253
environments: ['production'],
5354
config: {
5455
id: 'UA-27675533-1',
55-
require: ['linkid']
56-
}
56+
require: ['linkid'],
57+
},
5758
},
5859
],
5960
};

ember-cli-build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module.exports = function (defaults) {
66
let app = new EmberApp(defaults, {
77
fingerprint: {
88
extensions: ['js', 'css', 'map'],
9-
exclude: ['downloads']
9+
exclude: ['downloads'],
1010
},
1111
guidemaker: {
12-
premberVersionFilter: '3.24.0'
13-
}
12+
premberVersionFilter: '3.24.0',
13+
},
1414
});
1515

1616
// Use `app.import` to add additional libraries to the generated

extractCode.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@ const walkSync = require('walk-sync');
55
const _ = require('lodash');
66
const codeBlocks = require('gfm-code-blocks');
77
const { extname, join, dirname } = require('path');
8-
const {
9-
readFileSync,
10-
writeFileSync,
11-
mkdirSync,
12-
existsSync,
13-
} = require('fs');
8+
const { readFileSync, writeFileSync, mkdirSync, existsSync } = require('fs');
149

1510
// these regexs are used against the lang definition of a code block to identify
1611
// the language. If you only want to check certain types then you should change
1712
// this line
18-
const templatesMatch = /^(handlebars|html|text|javascript|bash|sh|css|hbs|json|apacheconf)/;
13+
const templatesMatch =
14+
/^(handlebars|html|text|javascript|bash|sh|css|hbs|json|apacheconf)/;
1915

2016
const mdFiles = _.chain(walkSync('guides/release'))
21-
.filter(path => extname(path) === '.md')
17+
.filter((path) => extname(path) === '.md')
2218
.value();
2319

2420
mdFiles.forEach((filename) => {
25-
const source = readFileSync(join(__dirname, 'guides', 'release', filename), 'utf-8');
21+
const source = readFileSync(
22+
join(__dirname, 'guides', 'release', filename),
23+
'utf-8'
24+
);
2625
// console.log(filename);
2726
const blocks = codeBlocks(source);
2827

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
const fetch = require('node-fetch');
22

33
module.exports = function checkExternalLink(url) {
4-
return fetch(url)
5-
.catch(() => { return { reason: 'Connection Refused', badLink: url }})
6-
.then(
7-
(response) => {
8-
if (!response.status) { return response; }
9-
if (response.ok) { return null; }
4+
return fetch(url)
5+
.catch(() => {
6+
return { reason: 'Connection Refused', badLink: url };
7+
})
8+
.then((response) => {
9+
if (!response.status) {
10+
return response;
11+
}
12+
if (response.ok) {
13+
return null;
14+
}
1015

11-
return { reason: response.status, badLink: url };
12-
}
13-
);
16+
return { reason: response.status, badLink: url };
17+
});
1418
};

node-tests/helpers/computeLinkRelativeToWorkingDir.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ const { normalize } = require('path');
1515
* @type {[type]}
1616
*/
1717
module.exports = function (cleanedFilepath, cleanedLink) {
18-
return (normalize(`${cleanedFilepath}/${cleanedLink}`));
18+
return normalize(`${cleanedFilepath}/${cleanedLink}`);
1919
};

node-tests/helpers/getBadImageUrls.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ const checkIfPathExists = require('./checkIfPathExists');
44

55
module.exports = function getBadRelativeUrlsForFile(mdFile) {
66
const badImages = _.chain(mdFile.links)
7-
.filter(link => link.endsWith('.png') || link.endsWith('.gif'))
7+
.filter((link) => link.endsWith('.png') || link.endsWith('.gif'))
88
.map((link) => {
99
// ignore external images
1010
if (link.startsWith('http://') || link.startsWith('https://')) {
1111
return null;
1212
}
1313
// all links need to be absolute
1414
if (!link.startsWith('/')) {
15-
return { fileToFix: mdFile.filepath, badImageLink: link, reason: 'not absolute path' };
15+
return {
16+
fileToFix: mdFile.filepath,
17+
badImageLink: link,
18+
reason: 'not absolute path',
19+
};
1620
}
1721

1822
if (!checkIfPathExists(`public/${link}`)) {
19-
return { fileToFix: mdFile.filepath, badImageLink: link, reason: 'file does not exist' };
23+
return {
24+
fileToFix: mdFile.filepath,
25+
badImageLink: link,
26+
reason: 'file does not exist',
27+
};
2028
}
2129

2230
// no issues found
@@ -26,8 +34,8 @@ module.exports = function getBadRelativeUrlsForFile(mdFile) {
2634
.value();
2735

2836
const traillingSlashImages = _.chain(mdFile.links)
29-
.filter(link => link.endsWith('.png/') || link.endsWith('.gif/'))
30-
.map(link => ({
37+
.filter((link) => link.endsWith('.png/') || link.endsWith('.gif/'))
38+
.map((link) => ({
3139
fileToFix: mdFile.filepath,
3240
badImageLink: link,
3341
reason: 'extra trailing slash on image',

node-tests/helpers/mapToLocalUrl.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
const apiDocsUrl = {remote: 'https://api.emberjs.com', local: 'https://api.emberjs.com'};
1+
const apiDocsUrl = {
2+
remote: 'https://api.emberjs.com',
3+
local: 'https://api.emberjs.com',
4+
};
25
//const apiDocsUrl = {remote: 'https://api.emberjs.com', local: 'http://locahost:4200'};
36

47
module.exports = function (url) {
5-
return url.replace(apiDocsUrl.remote, apiDocsUrl.local);
6-
}
8+
return url.replace(apiDocsUrl.remote, apiDocsUrl.local);
9+
};

0 commit comments

Comments
 (0)