Skip to content

Commit 6e4cb25

Browse files
committed
Merge branch 'main' into rfc-100-part1
* main: (37 commits) 8.55.0 Build: changelog update for 8.55.0 chore: upgrade @eslint/[email protected] (eslint#17811) chore: package.json update for @eslint/js release chore: upgrade @eslint/[email protected] (eslint#17799) feat: importNamePattern option in no-restricted-imports (eslint#17721) docs: fix typo `--rules` -> `--rule` (eslint#17806) ci: pin Node.js 21.2.0 (eslint#17809) chore: fix several `cli` tests to run in the intended flat config mode (eslint#17797) docs: remove "Open in Playground" buttons for removed rules (eslint#17791) docs: fix correct/incorrect examples of rules (eslint#17789) docs: update and fix examples for `no-unused-vars` (eslint#17788) docs: add specific stylistic rule for each deprecated rule (eslint#17778) chore: remove unused config-extends fixtures (eslint#17781) chore: remove formatting/stylistic rules from new rule templates (eslint#17780) chore: check rule examples for syntax errors (eslint#17718) 8.54.0 Build: changelog update for 8.54.0 chore: upgrade @eslint/[email protected] (eslint#17773) chore: package.json update for @eslint/js release ...
2 parents d185024 + e0cb960 commit 6e4cb25

File tree

179 files changed

+3105
-853
lines changed

Some content is hidden

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

179 files changed

+3105
-853
lines changed

.github/ISSUE_TEMPLATE/new-rule.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ body:
2626
options:
2727
- Warns about a potential problem
2828
- Suggests an alternate way of doing something
29-
- Enforces a formatting/stylistic preference
3029
validations:
3130
required: true
3231
- type: textarea

.github/ISSUE_TEMPLATE/rule-change.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body:
1515
required: true
1616
- type: dropdown
1717
attributes:
18-
label: What change to do you want to make?
18+
label: What change do you want to make?
1919
options:
2020
- Generate more warnings
2121
- Generate fewer warnings

.github/renovate.json5

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
":approveMajorUpdates",
6+
":semanticCommitScopeDisabled"
7+
],
8+
"ignorePresets": [":semanticPrefixFixDepsChoreOthers"],
9+
"labels": ["dependencies"],
10+
11+
// Wait well over npm's three day window for any new package as a precaution against malicious publishes
12+
// https://docs.npmjs.com/policies/unpublish/#packages-published-less-than-72-hours-ago
13+
"minimumReleaseAge": "7 days",
14+
15+
"packageRules": [
16+
{
17+
"description": "Use the deps:actions label for github-action manager updates (this means Renovate's github-action manager).",
18+
"addLabels": ["deps:actions"],
19+
"matchManagers": ["github-actions"]
20+
},
21+
{
22+
"description": "Use the deps:npm label for npm manager packages (this means Renovate's npm manager).",
23+
"addLabels": ["deps:npm"],
24+
"matchManagers": ["npm"]
25+
},
26+
{
27+
"description": "Group Babel packages into a single PR.",
28+
"groupName": "babel",
29+
"matchPackagePrefixes": ["@babel", "babel-"]
30+
},
31+
{
32+
"description": "Group wdio packages into a single PR.",
33+
"groupName": "wdio",
34+
"matchPackagePrefixes": ["@wdio"]
35+
},
36+
{
37+
"description": "Group metascraper packages into a single PR.",
38+
"groupName": "metascraper",
39+
"matchPackagePrefixes": ["metascraper"]
40+
}
41+
]
42+
}

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
run: npm run lint:scss
3434
- name: Lint Docs JS Files
3535
run: node Makefile lintDocsJS
36+
- name: Check Rule Examples
37+
run: node Makefile checkRuleExamples
3638
- name: Build Docs Website
3739
working-directory: docs
3840
run: npm run build
@@ -45,7 +47,7 @@ jobs:
4547
strategy:
4648
matrix:
4749
os: [ubuntu-latest]
48-
node: [21.x, 20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
50+
node: ["21.2.0", 20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
4951
include:
5052
- os: windows-latest
5153
node: "lts/*"

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
v8.55.0 - December 1, 2023
2+
3+
* [`eb8950c`](https://github.com/eslint/eslint/commit/eb8950c3b811c9163b9aae23af8b6266ad98b295) chore: upgrade @eslint/[email protected] (#17811) (Milos Djermanovic)
4+
* [`93df384`](https://github.com/eslint/eslint/commit/93df3849a7a25ebe0502000bf0bfb80a6613a5ae) chore: package.json update for @eslint/js release (Jenkins)
5+
* [`fe4b954`](https://github.com/eslint/eslint/commit/fe4b9545a83e9aca7ba4bb77bc9c868d57de777f) chore: upgrade @eslint/[email protected] (#17799) (Milos Djermanovic)
6+
* [`8c9e6c1`](https://github.com/eslint/eslint/commit/8c9e6c100a6eb69da292463293b3b48cff911a01) feat: importNamePattern option in no-restricted-imports (#17721) (Tanuj Kanti)
7+
* [`83ece2a`](https://github.com/eslint/eslint/commit/83ece2afc2dc6c49efe82678663fe4cba590c0e5) docs: fix typo `--rules` -> `--rule` (#17806) (OKURA Masafumi)
8+
* [`bd8911d`](https://github.com/eslint/eslint/commit/bd8911db85c7a1127543c9212c8cea47a5cb687d) ci: pin Node.js 21.2.0 (#17809) (Milos Djermanovic)
9+
* [`b29a16b`](https://github.com/eslint/eslint/commit/b29a16b22f234f6134475efb6c7be5ac946556ee) chore: fix several `cli` tests to run in the intended flat config mode (#17797) (Milos Djermanovic)
10+
* [`fffca5c`](https://github.com/eslint/eslint/commit/fffca5c362bcd205dbf79d1bb52834f8a98fc6bd) docs: remove "Open in Playground" buttons for removed rules (#17791) (Francesco Trotta)
11+
* [`a6d9442`](https://github.com/eslint/eslint/commit/a6d9442a9ab34d5d19f78d8c8fd0767a1237bfe3) docs: fix correct/incorrect examples of rules (#17789) (Tanuj Kanti)
12+
* [`383e999`](https://github.com/eslint/eslint/commit/383e99928d7ce649ec9030c9856b03fbac0c3501) docs: update and fix examples for `no-unused-vars` (#17788) (Tanuj Kanti)
13+
* [`5a8efd5`](https://github.com/eslint/eslint/commit/5a8efd5b7ad13eb320a1f468d1d4ab3c8ab99214) docs: add specific stylistic rule for each deprecated rule (#17778) (Etienne)
14+
* [`de165c1`](https://github.com/eslint/eslint/commit/de165c108203c6703516ac651f5b4cac5b241804) chore: remove unused config-extends fixtures (#17781) (Milos Djermanovic)
15+
* [`d4304b8`](https://github.com/eslint/eslint/commit/d4304b8b66eac870ffbf4840d84add8a123b25fc) chore: remove formatting/stylistic rules from new rule templates (#17780) (Francesco Trotta)
16+
* [`21024fe`](https://github.com/eslint/eslint/commit/21024fe2029420b413bed11d23761c87e9a02a1a) chore: check rule examples for syntax errors (#17718) (Francesco Trotta)
17+
18+
v8.54.0 - November 17, 2023
19+
20+
* [`d644de9`](https://github.com/eslint/eslint/commit/d644de9a4b593b565617303a095bc9aa69e7b768) chore: upgrade @eslint/[email protected] (#17773) (Milos Djermanovic)
21+
* [`1e6e314`](https://github.com/eslint/eslint/commit/1e6e31415cc429a3a9fc64b2ec03df0e0ec0c91b) chore: package.json update for @eslint/js release (Jenkins)
22+
* [`98926e6`](https://github.com/eslint/eslint/commit/98926e6e7323e5dd12a9f016cb558144296665af) fix: Ensure that extra data is not accidentally stored in the cache file (#17760) (Milos Djermanovic)
23+
* [`a7a883b`](https://github.com/eslint/eslint/commit/a7a883bd6ba4f140b60cbbb2be5b53d750f6c8db) feat: for-direction rule add check for condition in reverse order (#17755) (Angelo Annunziata)
24+
* [`1452dc9`](https://github.com/eslint/eslint/commit/1452dc9f12c45c05d7c569f737221f0d988ecef1) feat: Add suggestions to no-console (#17680) (Joel Mathew Koshy)
25+
* [`6fb8805`](https://github.com/eslint/eslint/commit/6fb8805310afe7476d6c404f172177a6d15fcf11) chore: Fixed grammar in issue_templates/rule_change (#17770) (Joel Mathew Koshy)
26+
* [`becfdd3`](https://github.com/eslint/eslint/commit/becfdd39b25d795e56c9a13eb3e77af6b9c86e8a) docs: Make clear when rules are removed (#17728) (Nicholas C. Zakas)
27+
* [`e8cf9f6`](https://github.com/eslint/eslint/commit/e8cf9f6a524332293f8b2c90a2db4a532e47d919) fix: Make dark scroll bar in dark theme (#17753) (Pavel)
28+
* [`85db724`](https://github.com/eslint/eslint/commit/85db7243ddb8706ed60ab64a7ddf604d0d7de493) chore: upgrade `markdownlint` to 0.31.1 (#17754) (Nitin Kumar)
29+
* [`21ebf8a`](https://github.com/eslint/eslint/commit/21ebf8a811be9f4b009cf70a10be5062d4fdc736) feat: update `no-array-constructor` rule (#17711) (Francesco Trotta)
30+
* [`05d6e99`](https://github.com/eslint/eslint/commit/05d6e99153ed6d94eb30f46c57609371918a41f3) docs: update "Submit a Pull Request" page (#17712) (Francesco Trotta)
31+
* [`eb2279e`](https://github.com/eslint/eslint/commit/eb2279e5148cee8fdea7dae614f4f8af7a2d06c3) docs: display info about deprecated rules (#17749) (Percy Ma)
32+
* [`6d470d2`](https://github.com/eslint/eslint/commit/6d470d2e74535761bd56dcb1c021b463ef9e8a9c) chore: update dependency recast to ^0.23.0 (#17736) (renovate[bot])
33+
* [`b7121b5`](https://github.com/eslint/eslint/commit/b7121b590d578c9c9b38ee481313317f30e54817) chore: update dependency markdownlint-cli to ^0.37.0 (#17735) (renovate[bot])
34+
* [`633b9a1`](https://github.com/eslint/eslint/commit/633b9a19752b6a22ab4d6c824f27a75ac0e4151b) chore: update dependency regenerator-runtime to ^0.14.0 (#17739) (renovate[bot])
35+
* [`acac16f`](https://github.com/eslint/eslint/commit/acac16fdf8540f7ba86cf637e3c1b253bd35a268) chore: update dependency vite-plugin-commonjs to ^0.10.0 (#17740) (renovate[bot])
36+
* [`ba8ca7e`](https://github.com/eslint/eslint/commit/ba8ca7e3debcba68ee7015b9221cf5acd7870206) chore: add .github/renovate.json5 (#17567) (Josh Goldberg ✨)
37+
* [`3cbeaad`](https://github.com/eslint/eslint/commit/3cbeaad7b943c153937ce34365cec2c406f2b98b) fix: Use `cwd` constructor option as config `basePath` in Linter (#17705) (Milos Djermanovic)
38+
* [`d245326`](https://github.com/eslint/eslint/commit/d24532601e64714ac5d08507e05aa5c14ecd1d5a) docs: Correct working in migrating plugin docs (#17722) (Filip Tammergård)
39+
* [`5454c22`](https://github.com/eslint/eslint/commit/5454c22b24f39be2dac7f28cfcfdb6c753faaf4e) Revert "chore: remove metascraper (#17707)" (#17708) (Milos Djermanovic)
40+
141
v8.53.0 - November 3, 2023
242

343
* [`ba4d4d5`](https://github.com/eslint/eslint/commit/ba4d4d567a82554250dd8c7933322824e6a73944) chore: remove metascraper (#17707) (Milos Djermanovic)

Makefile.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const checker = require("npm-license"),
1616
glob = require("glob"),
1717
marked = require("marked"),
1818
matter = require("gray-matter"),
19-
markdownlint = require("markdownlint"),
2019
os = require("os"),
2120
path = require("path"),
2221
semver = require("semver"),
@@ -216,7 +215,9 @@ function generateRuleIndexPage() {
216215
if (rule.meta.deprecated) {
217216
ruleTypesData.deprecated.push({
218217
name: basename,
219-
replacedBy: rule.meta.replacedBy || []
218+
replacedBy: rule.meta.replacedBy || [],
219+
fixable: !!rule.meta.fixable,
220+
hasSuggestions: !!rule.meta.hasSuggestions
220221
});
221222
} else {
222223
const output = {
@@ -431,6 +432,7 @@ function getFirstVersionOfDeletion(filePath) {
431432
* @private
432433
*/
433434
function lintMarkdown(files) {
435+
const markdownlint = require("markdownlint");
434436
const config = yaml.load(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")),
435437
result = markdownlint.sync({
436438
files,
@@ -865,6 +867,17 @@ target.checkRuleFiles = function() {
865867

866868
};
867869

870+
target.checkRuleExamples = function() {
871+
const { execFileSync } = require("child_process");
872+
873+
// We don't need the stack trace of execFileSync if the command fails.
874+
try {
875+
execFileSync(process.execPath, ["tools/check-rule-examples.js", "docs/src/rules/*.md"], { stdio: "inherit" });
876+
} catch {
877+
exit(1);
878+
}
879+
};
880+
868881
target.checkLicenses = function() {
869882

870883
/**

docs/.eleventy.js

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const { highlighter, lineNumberPlugin } = require("./src/_plugins/md-syntax-high
1414
const {
1515
DateTime
1616
} = require("luxon");
17+
const markdownIt = require("markdown-it");
18+
const markdownItRuleExample = require("./tools/markdown-it-rule-example");
1719

1820
module.exports = function(eleventyConfig) {
1921

@@ -113,7 +115,7 @@ module.exports = function(eleventyConfig) {
113115
* Source: https://github.com/11ty/eleventy/issues/658
114116
*/
115117
eleventyConfig.addFilter("markdown", value => {
116-
const markdown = require("markdown-it")({
118+
const markdown = markdownIt({
117119
html: true
118120
});
119121

@@ -191,57 +193,44 @@ module.exports = function(eleventyConfig) {
191193
return btoa(unescape(encodeURIComponent(text)));
192194
}
193195

194-
/**
195-
* Creates markdownItContainer settings for a playground-linked codeblock.
196-
* @param {string} name Plugin name and class name to add to the code block.
197-
* @returns {[string, object]} Plugin name and options for markdown-it.
198-
*/
199-
function withPlaygroundRender(name) {
200-
return [
201-
name,
202-
{
203-
render(tokens, index) {
204-
if (tokens[index].nesting !== 1) {
205-
return "</div>";
206-
}
207-
208-
// See https://github.com/eslint/eslint.org/blob/ac38ab41f99b89a8798d374f74e2cce01171be8b/src/playground/App.js#L44
209-
const parserOptionsJSON = tokens[index].info?.split("correct ")[1]?.trim();
210-
const parserOptions = { sourceType: "module", ...(parserOptionsJSON && JSON.parse(parserOptionsJSON)) };
211-
212-
// Remove trailing newline and presentational `⏎` characters (https://github.com/eslint/eslint/issues/17627):
213-
const content = tokens[index + 1].content
214-
.replace(/\n$/u, "")
215-
.replace(/(?=\n)/gu, "");
216-
const state = encodeToBase64(
217-
JSON.stringify({
218-
options: { parserOptions },
219-
text: content
220-
})
221-
);
222-
const prefix = process.env.CONTEXT && process.env.CONTEXT !== "deploy-preview"
223-
? ""
224-
: "https://eslint.org";
225-
226-
return `
227-
<div class="${name}">
196+
// markdown-it plugin options for playground-linked code blocks in rule examples.
197+
const ruleExampleOptions = markdownItRuleExample({
198+
open({ type, code, parserOptions, env }) {
199+
const isRuleRemoved = !Object.prototype.hasOwnProperty.call(env.rules_meta, env.title);
200+
201+
if (isRuleRemoved) {
202+
return `<div class="${type}">`;
203+
}
204+
205+
// See https://github.com/eslint/eslint.org/blob/ac38ab41f99b89a8798d374f74e2cce01171be8b/src/playground/App.js#L44
206+
const state = encodeToBase64(
207+
JSON.stringify({
208+
options: { parserOptions },
209+
text: code
210+
})
211+
);
212+
const prefix = process.env.CONTEXT && process.env.CONTEXT !== "deploy-preview"
213+
? ""
214+
: "https://eslint.org";
215+
216+
return `
217+
<div class="${type}">
228218
<a class="c-btn c-btn--secondary c-btn--playground" href="${prefix}/play#${state}" target="_blank">
229219
Open in Playground
230220
</a>
231-
`.trim();
232-
}
233-
}
234-
];
235-
}
221+
`.trim();
222+
},
223+
close() {
224+
return "</div>";
225+
}
226+
});
236227

237-
const markdownIt = require("markdown-it");
238228
const md = markdownIt({ html: true, linkify: true, typographer: true, highlight: (str, lang) => highlighter(md, str, lang) })
239229
.use(markdownItAnchor, {
240230
slugify: s => slug(s)
241231
})
242232
.use(markdownItContainer, "img-container", {})
243-
.use(markdownItContainer, ...withPlaygroundRender("correct"))
244-
.use(markdownItContainer, ...withPlaygroundRender("incorrect"))
233+
.use(markdownItContainer, "rule-example", ruleExampleOptions)
245234
.use(markdownItContainer, "warning", {
246235
render(tokens, idx) {
247236
return generateAlertMarkup("warning", tokens, idx);

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "docs-eslint",
33
"private": true,
4-
"version": "8.53.0",
4+
"version": "8.55.0",
55
"description": "",
66
"main": "index.js",
77
"keywords": [],

0 commit comments

Comments
 (0)