Skip to content

Commit

Permalink
Merge branch 'main' into rfc-100-part1
Browse files Browse the repository at this point in the history
* main: (37 commits)
  8.55.0
  Build: changelog update for 8.55.0
  chore: upgrade @eslint/js@8.55.0 (eslint#17811)
  chore: package.json update for @eslint/js release
  chore: upgrade @eslint/eslintrc@2.1.4 (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/js@8.54.0 (eslint#17773)
  chore: package.json update for @eslint/js release
  ...
  • Loading branch information
bmish committed Dec 1, 2023
2 parents d185024 + e0cb960 commit 6e4cb25
Show file tree
Hide file tree
Showing 179 changed files with 3,105 additions and 853 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/new-rule.yml
Expand Up @@ -26,7 +26,6 @@ body:
options:
- Warns about a potential problem
- Suggests an alternate way of doing something
- Enforces a formatting/stylistic preference
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/rule-change.yml
Expand Up @@ -15,7 +15,7 @@ body:
required: true
- type: dropdown
attributes:
label: What change to do you want to make?
label: What change do you want to make?
options:
- Generate more warnings
- Generate fewer warnings
Expand Down
42 changes: 42 additions & 0 deletions .github/renovate.json5
@@ -0,0 +1,42 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":approveMajorUpdates",
":semanticCommitScopeDisabled"
],
"ignorePresets": [":semanticPrefixFixDepsChoreOthers"],
"labels": ["dependencies"],

// Wait well over npm's three day window for any new package as a precaution against malicious publishes
// https://docs.npmjs.com/policies/unpublish/#packages-published-less-than-72-hours-ago
"minimumReleaseAge": "7 days",

"packageRules": [
{
"description": "Use the deps:actions label for github-action manager updates (this means Renovate's github-action manager).",
"addLabels": ["deps:actions"],
"matchManagers": ["github-actions"]
},
{
"description": "Use the deps:npm label for npm manager packages (this means Renovate's npm manager).",
"addLabels": ["deps:npm"],
"matchManagers": ["npm"]
},
{
"description": "Group Babel packages into a single PR.",
"groupName": "babel",
"matchPackagePrefixes": ["@babel", "babel-"]
},
{
"description": "Group wdio packages into a single PR.",
"groupName": "wdio",
"matchPackagePrefixes": ["@wdio"]
},
{
"description": "Group metascraper packages into a single PR.",
"groupName": "metascraper",
"matchPackagePrefixes": ["metascraper"]
}
]
}
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -33,6 +33,8 @@ jobs:
run: npm run lint:scss
- name: Lint Docs JS Files
run: node Makefile lintDocsJS
- name: Check Rule Examples
run: node Makefile checkRuleExamples
- name: Build Docs Website
working-directory: docs
run: npm run build
Expand All @@ -45,7 +47,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [21.x, 20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
node: ["21.2.0", 20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
include:
- os: windows-latest
node: "lts/*"
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,43 @@
v8.55.0 - December 1, 2023

* [`eb8950c`](https://github.com/eslint/eslint/commit/eb8950c3b811c9163b9aae23af8b6266ad98b295) chore: upgrade @eslint/js@8.55.0 (#17811) (Milos Djermanovic)
* [`93df384`](https://github.com/eslint/eslint/commit/93df3849a7a25ebe0502000bf0bfb80a6613a5ae) chore: package.json update for @eslint/js release (Jenkins)
* [`fe4b954`](https://github.com/eslint/eslint/commit/fe4b9545a83e9aca7ba4bb77bc9c868d57de777f) chore: upgrade @eslint/eslintrc@2.1.4 (#17799) (Milos Djermanovic)
* [`8c9e6c1`](https://github.com/eslint/eslint/commit/8c9e6c100a6eb69da292463293b3b48cff911a01) feat: importNamePattern option in no-restricted-imports (#17721) (Tanuj Kanti)
* [`83ece2a`](https://github.com/eslint/eslint/commit/83ece2afc2dc6c49efe82678663fe4cba590c0e5) docs: fix typo `--rules` -> `--rule` (#17806) (OKURA Masafumi)
* [`bd8911d`](https://github.com/eslint/eslint/commit/bd8911db85c7a1127543c9212c8cea47a5cb687d) ci: pin Node.js 21.2.0 (#17809) (Milos Djermanovic)
* [`b29a16b`](https://github.com/eslint/eslint/commit/b29a16b22f234f6134475efb6c7be5ac946556ee) chore: fix several `cli` tests to run in the intended flat config mode (#17797) (Milos Djermanovic)
* [`fffca5c`](https://github.com/eslint/eslint/commit/fffca5c362bcd205dbf79d1bb52834f8a98fc6bd) docs: remove "Open in Playground" buttons for removed rules (#17791) (Francesco Trotta)
* [`a6d9442`](https://github.com/eslint/eslint/commit/a6d9442a9ab34d5d19f78d8c8fd0767a1237bfe3) docs: fix correct/incorrect examples of rules (#17789) (Tanuj Kanti)
* [`383e999`](https://github.com/eslint/eslint/commit/383e99928d7ce649ec9030c9856b03fbac0c3501) docs: update and fix examples for `no-unused-vars` (#17788) (Tanuj Kanti)
* [`5a8efd5`](https://github.com/eslint/eslint/commit/5a8efd5b7ad13eb320a1f468d1d4ab3c8ab99214) docs: add specific stylistic rule for each deprecated rule (#17778) (Etienne)
* [`de165c1`](https://github.com/eslint/eslint/commit/de165c108203c6703516ac651f5b4cac5b241804) chore: remove unused config-extends fixtures (#17781) (Milos Djermanovic)
* [`d4304b8`](https://github.com/eslint/eslint/commit/d4304b8b66eac870ffbf4840d84add8a123b25fc) chore: remove formatting/stylistic rules from new rule templates (#17780) (Francesco Trotta)
* [`21024fe`](https://github.com/eslint/eslint/commit/21024fe2029420b413bed11d23761c87e9a02a1a) chore: check rule examples for syntax errors (#17718) (Francesco Trotta)

v8.54.0 - November 17, 2023

* [`d644de9`](https://github.com/eslint/eslint/commit/d644de9a4b593b565617303a095bc9aa69e7b768) chore: upgrade @eslint/js@8.54.0 (#17773) (Milos Djermanovic)
* [`1e6e314`](https://github.com/eslint/eslint/commit/1e6e31415cc429a3a9fc64b2ec03df0e0ec0c91b) chore: package.json update for @eslint/js release (Jenkins)
* [`98926e6`](https://github.com/eslint/eslint/commit/98926e6e7323e5dd12a9f016cb558144296665af) fix: Ensure that extra data is not accidentally stored in the cache file (#17760) (Milos Djermanovic)
* [`a7a883b`](https://github.com/eslint/eslint/commit/a7a883bd6ba4f140b60cbbb2be5b53d750f6c8db) feat: for-direction rule add check for condition in reverse order (#17755) (Angelo Annunziata)
* [`1452dc9`](https://github.com/eslint/eslint/commit/1452dc9f12c45c05d7c569f737221f0d988ecef1) feat: Add suggestions to no-console (#17680) (Joel Mathew Koshy)
* [`6fb8805`](https://github.com/eslint/eslint/commit/6fb8805310afe7476d6c404f172177a6d15fcf11) chore: Fixed grammar in issue_templates/rule_change (#17770) (Joel Mathew Koshy)
* [`becfdd3`](https://github.com/eslint/eslint/commit/becfdd39b25d795e56c9a13eb3e77af6b9c86e8a) docs: Make clear when rules are removed (#17728) (Nicholas C. Zakas)
* [`e8cf9f6`](https://github.com/eslint/eslint/commit/e8cf9f6a524332293f8b2c90a2db4a532e47d919) fix: Make dark scroll bar in dark theme (#17753) (Pavel)
* [`85db724`](https://github.com/eslint/eslint/commit/85db7243ddb8706ed60ab64a7ddf604d0d7de493) chore: upgrade `markdownlint` to 0.31.1 (#17754) (Nitin Kumar)
* [`21ebf8a`](https://github.com/eslint/eslint/commit/21ebf8a811be9f4b009cf70a10be5062d4fdc736) feat: update `no-array-constructor` rule (#17711) (Francesco Trotta)
* [`05d6e99`](https://github.com/eslint/eslint/commit/05d6e99153ed6d94eb30f46c57609371918a41f3) docs: update "Submit a Pull Request" page (#17712) (Francesco Trotta)
* [`eb2279e`](https://github.com/eslint/eslint/commit/eb2279e5148cee8fdea7dae614f4f8af7a2d06c3) docs: display info about deprecated rules (#17749) (Percy Ma)
* [`6d470d2`](https://github.com/eslint/eslint/commit/6d470d2e74535761bd56dcb1c021b463ef9e8a9c) chore: update dependency recast to ^0.23.0 (#17736) (renovate[bot])
* [`b7121b5`](https://github.com/eslint/eslint/commit/b7121b590d578c9c9b38ee481313317f30e54817) chore: update dependency markdownlint-cli to ^0.37.0 (#17735) (renovate[bot])
* [`633b9a1`](https://github.com/eslint/eslint/commit/633b9a19752b6a22ab4d6c824f27a75ac0e4151b) chore: update dependency regenerator-runtime to ^0.14.0 (#17739) (renovate[bot])
* [`acac16f`](https://github.com/eslint/eslint/commit/acac16fdf8540f7ba86cf637e3c1b253bd35a268) chore: update dependency vite-plugin-commonjs to ^0.10.0 (#17740) (renovate[bot])
* [`ba8ca7e`](https://github.com/eslint/eslint/commit/ba8ca7e3debcba68ee7015b9221cf5acd7870206) chore: add .github/renovate.json5 (#17567) (Josh Goldberg ✨)
* [`3cbeaad`](https://github.com/eslint/eslint/commit/3cbeaad7b943c153937ce34365cec2c406f2b98b) fix: Use `cwd` constructor option as config `basePath` in Linter (#17705) (Milos Djermanovic)
* [`d245326`](https://github.com/eslint/eslint/commit/d24532601e64714ac5d08507e05aa5c14ecd1d5a) docs: Correct working in migrating plugin docs (#17722) (Filip Tammergård)
* [`5454c22`](https://github.com/eslint/eslint/commit/5454c22b24f39be2dac7f28cfcfdb6c753faaf4e) Revert "chore: remove metascraper (#17707)" (#17708) (Milos Djermanovic)

v8.53.0 - November 3, 2023

* [`ba4d4d5`](https://github.com/eslint/eslint/commit/ba4d4d567a82554250dd8c7933322824e6a73944) chore: remove metascraper (#17707) (Milos Djermanovic)
Expand Down
17 changes: 15 additions & 2 deletions Makefile.js
Expand Up @@ -16,7 +16,6 @@ const checker = require("npm-license"),
glob = require("glob"),
marked = require("marked"),
matter = require("gray-matter"),
markdownlint = require("markdownlint"),
os = require("os"),
path = require("path"),
semver = require("semver"),
Expand Down Expand Up @@ -216,7 +215,9 @@ function generateRuleIndexPage() {
if (rule.meta.deprecated) {
ruleTypesData.deprecated.push({
name: basename,
replacedBy: rule.meta.replacedBy || []
replacedBy: rule.meta.replacedBy || [],
fixable: !!rule.meta.fixable,
hasSuggestions: !!rule.meta.hasSuggestions
});
} else {
const output = {
Expand Down Expand Up @@ -431,6 +432,7 @@ function getFirstVersionOfDeletion(filePath) {
* @private
*/
function lintMarkdown(files) {
const markdownlint = require("markdownlint");
const config = yaml.load(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")),
result = markdownlint.sync({
files,
Expand Down Expand Up @@ -865,6 +867,17 @@ target.checkRuleFiles = function() {

};

target.checkRuleExamples = function() {
const { execFileSync } = require("child_process");

// We don't need the stack trace of execFileSync if the command fails.
try {
execFileSync(process.execPath, ["tools/check-rule-examples.js", "docs/src/rules/*.md"], { stdio: "inherit" });
} catch {
exit(1);
}
};

target.checkLicenses = function() {

/**
Expand Down
75 changes: 32 additions & 43 deletions docs/.eleventy.js
Expand Up @@ -14,6 +14,8 @@ const { highlighter, lineNumberPlugin } = require("./src/_plugins/md-syntax-high
const {
DateTime
} = require("luxon");
const markdownIt = require("markdown-it");
const markdownItRuleExample = require("./tools/markdown-it-rule-example");

module.exports = function(eleventyConfig) {

Expand Down Expand Up @@ -113,7 +115,7 @@ module.exports = function(eleventyConfig) {
* Source: https://github.com/11ty/eleventy/issues/658
*/
eleventyConfig.addFilter("markdown", value => {
const markdown = require("markdown-it")({
const markdown = markdownIt({
html: true
});

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

/**
* Creates markdownItContainer settings for a playground-linked codeblock.
* @param {string} name Plugin name and class name to add to the code block.
* @returns {[string, object]} Plugin name and options for markdown-it.
*/
function withPlaygroundRender(name) {
return [
name,
{
render(tokens, index) {
if (tokens[index].nesting !== 1) {
return "</div>";
}

// See https://github.com/eslint/eslint.org/blob/ac38ab41f99b89a8798d374f74e2cce01171be8b/src/playground/App.js#L44
const parserOptionsJSON = tokens[index].info?.split("correct ")[1]?.trim();
const parserOptions = { sourceType: "module", ...(parserOptionsJSON && JSON.parse(parserOptionsJSON)) };

// Remove trailing newline and presentational `⏎` characters (https://github.com/eslint/eslint/issues/17627):
const content = tokens[index + 1].content
.replace(/\n$/u, "")
.replace(/⏎(?=\n)/gu, "");
const state = encodeToBase64(
JSON.stringify({
options: { parserOptions },
text: content
})
);
const prefix = process.env.CONTEXT && process.env.CONTEXT !== "deploy-preview"
? ""
: "https://eslint.org";

return `
<div class="${name}">
// markdown-it plugin options for playground-linked code blocks in rule examples.
const ruleExampleOptions = markdownItRuleExample({
open({ type, code, parserOptions, env }) {
const isRuleRemoved = !Object.prototype.hasOwnProperty.call(env.rules_meta, env.title);

if (isRuleRemoved) {
return `<div class="${type}">`;
}

// See https://github.com/eslint/eslint.org/blob/ac38ab41f99b89a8798d374f74e2cce01171be8b/src/playground/App.js#L44
const state = encodeToBase64(
JSON.stringify({
options: { parserOptions },
text: code
})
);
const prefix = process.env.CONTEXT && process.env.CONTEXT !== "deploy-preview"
? ""
: "https://eslint.org";

return `
<div class="${type}">
<a class="c-btn c-btn--secondary c-btn--playground" href="${prefix}/play#${state}" target="_blank">
Open in Playground
</a>
`.trim();
}
}
];
}
`.trim();
},
close() {
return "</div>";
}
});

const markdownIt = require("markdown-it");
const md = markdownIt({ html: true, linkify: true, typographer: true, highlight: (str, lang) => highlighter(md, str, lang) })
.use(markdownItAnchor, {
slugify: s => slug(s)
})
.use(markdownItContainer, "img-container", {})
.use(markdownItContainer, ...withPlaygroundRender("correct"))
.use(markdownItContainer, ...withPlaygroundRender("incorrect"))
.use(markdownItContainer, "rule-example", ruleExampleOptions)
.use(markdownItContainer, "warning", {
render(tokens, idx) {
return generateAlertMarkup("warning", tokens, idx);
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
@@ -1,7 +1,7 @@
{
"name": "docs-eslint",
"private": true,
"version": "8.53.0",
"version": "8.55.0",
"description": "",
"main": "index.js",
"keywords": [],
Expand Down

0 comments on commit 6e4cb25

Please sign in to comment.