Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9fafe45

Browse filesBrowse files
docs: upgrade to 11ty 2.0 (#17632)
* docs: upgrade to 11ty 2.0 * docs: fix broken links * chore: clean * Update Makefile.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * chore: change filename --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent ff8e4bf commit 9fafe45
Copy full SHA for 9fafe45

File tree

Expand file treeCollapse file tree

7 files changed

+2093
-2119
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+2093
-2119
lines changed

‎Makefile.js

Copy file name to clipboardExpand all lines: Makefile.js
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function generateRuleIndexPage() {
214214
};
215215

216216
if (rule.meta.deprecated) {
217-
ruleTypesData.deprecated.rules.push({
217+
ruleTypesData.deprecated.push({
218218
name: basename,
219219
replacedBy: rule.meta.replacedBy || []
220220
});
@@ -226,22 +226,18 @@ function generateRuleIndexPage() {
226226
fixable: !!rule.meta.fixable,
227227
hasSuggestions: !!rule.meta.hasSuggestions
228228
},
229-
ruleType = ruleTypesData.types.find(c => c.name === rule.meta.type);
229+
ruleType = ruleTypesData.types[rule.meta.type];
230230

231-
if (!ruleType.rules) {
232-
ruleType.rules = [];
233-
}
234-
235-
ruleType.rules.push(output);
231+
ruleType.push(output);
236232
}
237233
});
238234

239-
// `.rules` will be `undefined` if all rules in category are deprecated.
240-
ruleTypesData.types = ruleTypesData.types.filter(ruleType => !!ruleType.rules);
235+
ruleTypesData.types = Object.fromEntries(
236+
Object.entries(ruleTypesData.types).filter(([, value]) => value && value.length > 0)
237+
);
241238

242239
JSON.stringify(ruleTypesData, null, 4).to(docsSiteOutputFile);
243240
JSON.stringify(meta, null, 4).to(docsSiteMetaOutputFile);
244-
245241
}
246242

247243
/**

‎conf/rule-type-list.json

Copy file name to clipboard
+25-33Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
11
{
2-
"types": [
3-
{ "name": "problem", "displayName": "Possible Problems", "description": "These rules relate to possible logic errors in code:" },
4-
{ "name": "suggestion", "displayName": "Suggestions", "description": "These rules suggest alternate ways of doing things:" },
5-
{ "name": "layout", "displayName": "Layout & Formatting", "description": "These rules care about how the code looks rather than how it executes:" }
6-
],
7-
"deprecated": {
8-
"name": "Deprecated",
9-
"description": "These rules have been deprecated in accordance with the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a>, and replaced by newer rules:",
10-
"rules": []
2+
"types": {
3+
"problem": [],
4+
"suggestion": [],
5+
"layout": []
116
},
12-
"removed": {
13-
"name": "Removed",
14-
"description": "These rules from older versions of ESLint (before the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a> existed) have been replaced by newer rules:",
15-
"rules": [
16-
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
17-
{ "removed": "global-strict", "replacedBy": ["strict"] },
18-
{ "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] },
19-
{ "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] },
20-
{ "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] },
21-
{ "removed": "no-empty-label", "replacedBy": ["no-labels"] },
22-
{ "removed": "no-extra-strict", "replacedBy": ["strict"] },
23-
{ "removed": "no-reserved-keys", "replacedBy": ["quote-props"] },
24-
{ "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] },
25-
{ "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] },
26-
{ "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] },
27-
{ "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] },
28-
{ "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] },
29-
{ "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] },
30-
{ "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] },
31-
{ "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] },
32-
{ "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] },
33-
{ "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] }
34-
]
35-
}
7+
"deprecated": [],
8+
"removed": [
9+
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
10+
{ "removed": "global-strict", "replacedBy": ["strict"] },
11+
{ "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] },
12+
{ "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] },
13+
{ "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] },
14+
{ "removed": "no-empty-label", "replacedBy": ["no-labels"] },
15+
{ "removed": "no-extra-strict", "replacedBy": ["strict"] },
16+
{ "removed": "no-reserved-keys", "replacedBy": ["quote-props"] },
17+
{ "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] },
18+
{ "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] },
19+
{ "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] },
20+
{ "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] },
21+
{ "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] },
22+
{ "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] },
23+
{ "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] },
24+
{ "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] },
25+
{ "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] },
26+
{ "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] }
27+
]
3628
}

‎docs/.eleventy.js

Copy file name to clipboardExpand all lines: docs/.eleventy.js
+1-21Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = function(eleventyConfig) {
5454
eleventyConfig.addGlobalData("GIT_BRANCH", process.env.BRANCH);
5555
eleventyConfig.addGlobalData("HEAD", process.env.BRANCH === "main");
5656
eleventyConfig.addGlobalData("NOINDEX", process.env.BRANCH !== "latest");
57+
eleventyConfig.addGlobalData("PATH_PREFIX", pathPrefix);
5758
eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
5859

5960
//------------------------------------------------------------------------------
@@ -487,25 +488,6 @@ module.exports = function(eleventyConfig) {
487488
// Settings
488489
//------------------------------------------------------------------------------
489490

490-
/*
491-
* When we run `eleventy --serve`, Eleventy 1.x uses browser-sync to serve the content.
492-
* By default, browser-sync (more precisely, underlying serve-static) will not serve
493-
* `foo/bar.html` when we request `foo/bar`. Thus, we need to rewrite URLs to append `.html`
494-
* so that pretty links without `.html` can work in a local development environment.
495-
*
496-
* There's no need to rewrite URLs that end with `/`, because that already works well
497-
* (server will return the content of `index.html` in the directory).
498-
* URLs with a file extension, like main.css, main.js, sitemap.xml, etc. should not be rewritten
499-
*/
500-
eleventyConfig.setBrowserSyncConfig({
501-
middleware(req, res, next) {
502-
if (!/(?:\.[a-zA-Z][^/]*|\/)$/u.test(req.url)) {
503-
req.url += ".html";
504-
}
505-
return next();
506-
}
507-
});
508-
509491
/*
510492
* Generate the sitemap only in certain contexts to prevent unwanted discovery of sitemaps that
511493
* contain URLs we'd prefer not to appear in search results (URLs in sitemaps are considered important).
@@ -525,14 +507,12 @@ module.exports = function(eleventyConfig) {
525507
eleventyConfig.ignores.add("src/static/sitemap.njk"); // ... then don't generate the sitemap.
526508
}
527509

528-
529510
return {
530511
passthroughFileCopy: true,
531512

532513
pathPrefix,
533514

534515
markdownTemplateEngine: "njk",
535-
dataTemplateEngine: "njk",
536516
htmlTemplateEngine: "njk",
537517

538518
dir: {

‎docs/package.json

Copy file name to clipboardExpand all lines: docs/package.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"start": "npm-run-all build:sass build:postcss --parallel *:*:watch"
2424
},
2525
"devDependencies": {
26-
"@11ty/eleventy": "^1.0.1",
27-
"@11ty/eleventy-img": "^1.0.0",
28-
"@11ty/eleventy-navigation": "^0.3.2",
26+
"@11ty/eleventy": "^2.0.1",
27+
"@11ty/eleventy-img": "^3.1.1",
28+
"@11ty/eleventy-navigation": "^0.3.5",
2929
"@11ty/eleventy-plugin-rss": "^1.1.1",
30-
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
30+
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
3131
"@munter/tap-render": "^0.2.0",
3232
"@types/markdown-it": "^12.2.3",
3333
"algoliasearch": "^4.12.1",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.