diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 35d24100191..5fd747b2906 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ #### Prerequisites checklist diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..4fa6f8f24a7 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,29 @@ +documentation: +- any: + - changed-files: + - all-globs-to-all-files: ['docs/**', '!lib/rules/**'] + +rule: +- any: + - changed-files: + - any-glob-to-any-file: ['lib/rules/**'] + +cli: +- any: + - changed-files: + - any-glob-to-any-file: ['lib/cli.js', 'lib/options.js', 'lib/cli-engine/**', 'lib/eslint/**'] + +core: +- any: + - changed-files: + - any-glob-to-any-file: ['lib/{config,eslint,linter,rule-tester,source-code}/**', 'lib/api.js'] + +formatter: +- any: + - changed-files: + - any-glob-to-any-file: ['lib/cli-engine/formatters/**'] + +"github actions": +- any: + - changed-files: + - any-glob-to-any-file: ['.github/workflows/**'] diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 00000000000..d58080259b8 --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: pull_request_target +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + sync-labels: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c0fcdad68..3851ec24140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,72 @@ +v9.0.0-beta.1 - February 23, 2024 + +* [`32ffdd1`](https://github.com/eslint/eslint/commit/32ffdd181aa673ccc596f714d10a2f879ec622a7) chore: upgrade @eslint/js@9.0.0-beta.1 (#18146) (Milos Djermanovic) +* [`e41425b`](https://github.com/eslint/eslint/commit/e41425b5c3b4c885f2679a3663bd081911a8b570) chore: package.json update for @eslint/js release (Jenkins) +* [`bb3b9c6`](https://github.com/eslint/eslint/commit/bb3b9c68fe714bb8aa305be5f019a7a42f4374ee) chore: upgrade @eslint/eslintrc@3.0.2 (#18145) (Milos Djermanovic) +* [`c9f2f33`](https://github.com/eslint/eslint/commit/c9f2f3343e7c197e5e962c68ef202d6a1646866e) build: changelog update for 8.57.0 (#18144) (Milos Djermanovic) +* [`5fe095c`](https://github.com/eslint/eslint/commit/5fe095cf718b063dc5e58089b0a6cbcd53da7925) docs: show v8.57.0 as latest version in dropdown (#18142) (Milos Djermanovic) +* [`0cb4914`](https://github.com/eslint/eslint/commit/0cb4914ef93cd572ba368d390b1cf0b93f578a9d) fix: validate options when comment with just severity enables rule (#18133) (Milos Djermanovic) +* [`7db5bb2`](https://github.com/eslint/eslint/commit/7db5bb270f95d1472de0bfed0e33ed5ab294942e) docs: Show prerelease version in dropdown (#18135) (Nicholas C. Zakas) +* [`e462524`](https://github.com/eslint/eslint/commit/e462524cc318ffacecd266e6fe1038945a0b02e9) chore: upgrade eslint-release@3.2.2 (#18138) (Milos Djermanovic) +* [`8e13a6b`](https://github.com/eslint/eslint/commit/8e13a6beb587e624cc95ae16eefe503ad024b11b) chore: fix spelling mistake in README.md (#18128) (Will Eastcott) +* [`66f52e2`](https://github.com/eslint/eslint/commit/66f52e276c31487424bcf54e490c4ac7ef70f77f) chore: remove unused tools rule-types.json, update-rule-types.js (#18125) (Josh Goldberg ✨) +* [`bf0c7ef`](https://github.com/eslint/eslint/commit/bf0c7effdba51c48b929d06ce1965408a912dc77) ci: fix sync-labels value of pr-labeler (#18124) (Tanuj Kanti) +* [`cace6d0`](https://github.com/eslint/eslint/commit/cace6d0a3afa5c84b18abee4ef8c598125143461) ci: add PR labeler action (#18109) (Nitin Kumar) +* [`73a5f06`](https://github.com/eslint/eslint/commit/73a5f0641b43e169247b0000f44a366ee6bbc4f2) docs: Update README (GitHub Actions Bot) +* [`74124c2`](https://github.com/eslint/eslint/commit/74124c20287fac1995c3f4e553f0723c066f311d) feat: add suggestions to `use-isnan` in `indexOf` & `lastIndexOf` calls (#18063) (StyleShit) +* [`1a65d3e`](https://github.com/eslint/eslint/commit/1a65d3e4a6ee16e3f607d69b998a08c3fed505ca) chore: export `base` config from `eslint-config-eslint` (#18119) (Milos Djermanovic) +* [`f95cd27`](https://github.com/eslint/eslint/commit/f95cd27679eef228173e27e170429c9710c939b3) docs: Disallow multiple rule configuration comments in the same example (#18116) (Milos Djermanovic) +* [`9aa4df3`](https://github.com/eslint/eslint/commit/9aa4df3f4d85960eee72923f3b9bfc88e62f04fb) refactor: remove `globals` dependency (#18115) (Milos Djermanovic) +* [`d8068ec`](https://github.com/eslint/eslint/commit/d8068ec70fac050e900dc400510a4ad673e17633) docs: Update link for schema examples (#18112) (Svetlana) + +v8.57.0 - February 23, 2024 + +* [`1813aec`](https://github.com/eslint/eslint/commit/1813aecc4660582b0678cf32ba466eb9674266c4) chore: upgrade @eslint/js@8.57.0 (#18143) (Milos Djermanovic) +* [`5c356bb`](https://github.com/eslint/eslint/commit/5c356bb0c6f53c570224f8e9f02c4baca8fc6d2f) chore: package.json update for @eslint/js release (Jenkins) +* [`84922d0`](https://github.com/eslint/eslint/commit/84922d0bfa10689a34a447ab8e55975ff1c1c708) docs: Show prerelease version in dropdown (#18139) (Nicholas C. Zakas) +* [`1120b9b`](https://github.com/eslint/eslint/commit/1120b9b7b97f10f059d8b7ede19de2572f892366) feat: Add loadESLint() API method for v8 (#18098) (Nicholas C. Zakas) +* [`5b8c363`](https://github.com/eslint/eslint/commit/5b8c3636a3d7536535a6878eca0e5b773e4829d4) docs: Switch to Ethical Ads (#18117) (Milos Djermanovic) +* [`2196d97`](https://github.com/eslint/eslint/commit/2196d97094ba94d6d750828879a29538d1600de5) fix: handle absolute file paths in `FlatRuleTester` (#18064) (Nitin Kumar) +* [`f4a1fe2`](https://github.com/eslint/eslint/commit/f4a1fe2e45aa1089fe775290bf530de82f34bf16) test: add more tests for ignoring files and directories (#18068) (Nitin Kumar) +* [`69dd1d1`](https://github.com/eslint/eslint/commit/69dd1d1387b7b53617548d1f9f2c149f179e6e17) fix: Ensure config keys are printed for config errors (#18067) (Nitin Kumar) +* [`9852a31`](https://github.com/eslint/eslint/commit/9852a31edcf054bd5d15753ef18e2ad3216b1b71) fix: deep merge behavior in flat config (#18065) (Nitin Kumar) +* [`dca7d0f`](https://github.com/eslint/eslint/commit/dca7d0f1c262bc72310147bcefe1d04ecf60acbc) feat: Enable `eslint.config.mjs` and `eslint.config.cjs` (#18066) (Nitin Kumar) +* [`4c7e9b0`](https://github.com/eslint/eslint/commit/4c7e9b0b539ba879ac1799e81f3b6add2eed4b2f) fix: allow circular references in config (#18056) (Milos Djermanovic) +* [`77dbfd9`](https://github.com/eslint/eslint/commit/77dbfd9887b201a46fc68631cbde50c08e1a8dbf) docs: show NEXT in version selectors (#18052) (Milos Djermanovic) +* [`42c0aef`](https://github.com/eslint/eslint/commit/42c0aefaf6ea8b998b1c6db61906a79c046d301a) ci: Enable CI for `v8.x` branch (#18047) (Milos Djermanovic) + +v9.0.0-beta.0 - February 9, 2024 + +* [`e40d1d7`](https://github.com/eslint/eslint/commit/e40d1d74a5b9788cbec195f4e602b50249f26659) chore: upgrade @eslint/js@9.0.0-beta.0 (#18108) (Milos Djermanovic) +* [`9870f93`](https://github.com/eslint/eslint/commit/9870f93e714edefb410fccae1e9924a3c1972a2e) chore: package.json update for @eslint/js release (Jenkins) +* [`2c62e79`](https://github.com/eslint/eslint/commit/2c62e797a433e5fc298b976872a89c594f88bb19) chore: upgrade @eslint/eslintrc@3.0.1 (#18107) (Milos Djermanovic) +* [`81f0294`](https://github.com/eslint/eslint/commit/81f0294e651928b49eb49495b90b54376073a790) chore: upgrade espree@10.0.1 (#18106) (Milos Djermanovic) +* [`5e2b292`](https://github.com/eslint/eslint/commit/5e2b2922aa65bda54b0966d1bf71acda82b3047c) chore: upgrade eslint-visitor-keys@4.0.0 (#18105) (Milos Djermanovic) +* [`9163646`](https://github.com/eslint/eslint/commit/916364692bae6a93c10b5d48fc1e9de1677d0d09) feat!: Rule Tester checks for missing placeholder data in the message (#18073) (fnx) +* [`53f0f47`](https://github.com/eslint/eslint/commit/53f0f47badffa1b04ec2836f2ae599f4fc464da2) feat: Add loadESLint() API method for v9 (#18097) (Nicholas C. Zakas) +* [`f1c7e6f`](https://github.com/eslint/eslint/commit/f1c7e6fc8ea77fcdae4ad1f8fe1cd104a281d2e9) docs: Switch to Ethical Ads (#18090) (Strek) +* [`15c143f`](https://github.com/eslint/eslint/commit/15c143f96ef164943fd3d39b5ad79d9a4a40de8f) docs: JS Foundation -> OpenJS Foundation in PR template (#18092) (Nicholas C. Zakas) +* [`c4d26fd`](https://github.com/eslint/eslint/commit/c4d26fd3d1f59c1c0f2266664887ad18692039f3) fix: `use-isnan` doesn't report on `SequenceExpression`s (#18059) (StyleShit) +* [`6ea339e`](https://github.com/eslint/eslint/commit/6ea339e658d29791528ab26aabd86f1683cab6c3) docs: add stricter rule test validations to v9 migration guide (#18085) (Milos Djermanovic) +* [`ce838ad`](https://github.com/eslint/eslint/commit/ce838adc3b673e52a151f36da0eedf5876977514) chore: replace dependency npm-run-all with npm-run-all2 ^5.0.0 (#18045) (renovate[bot]) +* [`3c816f1`](https://github.com/eslint/eslint/commit/3c816f193eecace5efc6166efa2852a829175ef8) docs: use relative link from CLI to core concepts (#18083) (Milos Djermanovic) +* [`54df731`](https://github.com/eslint/eslint/commit/54df731174d2528170560d1f765e1336eca0a8bd) chore: update dependency markdownlint-cli to ^0.39.0 (#18084) (renovate[bot]) +* [`9458735`](https://github.com/eslint/eslint/commit/9458735381269d12b24f76e1b2b6fda1bc5a509b) docs: fix malformed `eslint` config comments in rule examples (#18078) (Francesco Trotta) +* [`07a1ada`](https://github.com/eslint/eslint/commit/07a1ada7166b76c7af6186f4c5e5de8b8532edba) docs: link from `--fix` CLI doc to the relevant core concept (#18080) (Bryan Mishkin) +* [`8f06a60`](https://github.com/eslint/eslint/commit/8f06a606845f40aaf0fea1fd83d5930747c5acec) chore: update dependency shelljs to ^0.8.5 (#18079) (Francesco Trotta) +* [`b844324`](https://github.com/eslint/eslint/commit/b844324e4e8f511c9985a96c7aca063269df9570) docs: Update team responsibilities (#18048) (Nicholas C. Zakas) +* [`aadfb60`](https://github.com/eslint/eslint/commit/aadfb609f1b847e492fc3b28ced62f830fe7f294) docs: document languageOptions and other v9 changes for context (#18074) (fnx) +* [`3c4d51d`](https://github.com/eslint/eslint/commit/3c4d51d55fa5435ab18b6bf46f6b97df0f480ae7) feat!: default for `enforceForClassMembers` in `no-useless-computed-key` (#18054) (Francesco Trotta) +* [`47e60f8`](https://github.com/eslint/eslint/commit/47e60f85e0c3f275207bb4be9b5947166a190477) feat!: Stricter rule test validations (#17654) (fnx) +* [`1a94589`](https://github.com/eslint/eslint/commit/1a945890105d307541dcbff15f6438c19b476ade) feat!: `no-unused-vars` default caughtErrors to 'all' (#18043) (Josh Goldberg ✨) +* [`857e242`](https://github.com/eslint/eslint/commit/857e242584227181ecb8af79fc6bc236b9975228) docs: tweak explanation for meta.docs rule properties (#18057) (Bryan Mishkin) +* [`10485e8`](https://github.com/eslint/eslint/commit/10485e8b961d045514bc1e34227cf09867a6c4b7) docs: recommend messageId over message for reporting rule violations (#18050) (Bryan Mishkin) +* [`98b5ab4`](https://github.com/eslint/eslint/commit/98b5ab406bac6279eadd84e8a5fd5a01fc586ff1) docs: Update README (GitHub Actions Bot) +* [`93ffe30`](https://github.com/eslint/eslint/commit/93ffe30da5e2127e336c1c22e69e09ec0558a8e6) chore: update dependency file-entry-cache to v8 (#17903) (renovate[bot]) +* [`505fbf4`](https://github.com/eslint/eslint/commit/505fbf4b35c14332bffb0c838cce4843a00fad68) docs: update `no-restricted-imports` rule (#18015) (Tanuj Kanti) +* [`2d11d46`](https://github.com/eslint/eslint/commit/2d11d46e890a9f1b5f639b8ee034ffa9bd453e42) feat: add suggestions to `use-isnan` in binary expressions (#17996) (StyleShit) +* [`c25b4af`](https://github.com/eslint/eslint/commit/c25b4aff1fe35e5bd9d4fcdbb45b739b6d253828) docs: Update README (GitHub Actions Bot) + v9.0.0-alpha.2 - January 26, 2024 * [`6ffdcbb`](https://github.com/eslint/eslint/commit/6ffdcbb8c51956054d3f81c5ce446c15dcd51a6f) chore: upgrade @eslint/js@9.0.0-alpha.2 (#18038) (Milos Djermanovic) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3c3a2a2e02..331622770d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ Before filing an issue, please be sure to read the guidelines for what you're re * [Propose a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change) * [Request a Change](https://eslint.org/docs/latest/contribute/request-change) -To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint). +To report a security vulnerability in ESLint, please use our [create an advisory form](https://github.com/eslint/eslint/security/advisories/new) on GitHub. ## Contributing Code diff --git a/Makefile.js b/Makefile.js index 6d3395e1615..ab4d15c1b94 100644 --- a/Makefile.js +++ b/Makefile.js @@ -674,7 +674,6 @@ target.checkRuleFiles = function() { echo("Validating rules"); - const ruleTypes = require("./tools/rule-types.json"); let errors = 0; RULE_FILES.forEach(filename => { @@ -686,14 +685,6 @@ target.checkRuleFiles = function() { const ruleCode = cat(filename); const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"]; - /** - * Check if basename is present in rule-types.json file. - * @returns {boolean} true if present - * @private - */ - function isInRuleTypes() { - return Object.hasOwn(ruleTypes, basename); - } /** * Check if id is present in title @@ -776,12 +767,6 @@ target.checkRuleFiles = function() { } } - // check for recommended configuration - if (!isInRuleTypes()) { - console.error("Missing setting for %s in tools/rule-types.json", basename); - errors++; - } - // check parity between rules index file and rules directory const ruleIdsInIndex = require("./lib/rules/index"); const ruleDef = ruleIdsInIndex.get(basename); diff --git a/README.md b/README.md index 4ec49748cc2..0f90821dc67 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ We are now at or near 100% compatibility with JSCS. If you try ESLint and believ ### Does Prettier replace ESLint? -No, ESLint and Prettier have diffent jobs: ESLint is a linter (looking for problematic patterns) and Prettier is a code formatter. Using both tools is common, refer to [Prettier's documentation](https://prettier.io/docs/en/install#eslint-and-other-linters) to learn how to configure them to work well with each other. +No, ESLint and Prettier have different jobs: ESLint is a linter (looking for problematic patterns) and Prettier is a code formatter. Using both tools is common, refer to [Prettier's documentation](https://prettier.io/docs/en/install#eslint-and-other-linters) to learn how to configure them to work well with each other. ### Why can't ESLint find my plugins? @@ -294,7 +294,7 @@ The following companies, organizations, and individuals support ESLint's ongoing

Chrome Frameworks Fund Automattic

Gold Sponsors

Salesforce Airbnb

Silver Sponsors

JetBrains Liftoff American Express Workleap

Bronze Sponsors

-

ThemeIsle Anagram Solver Icons8 Discord Transloadit Ignition Nx HeroCoders Nextbase Starter Kit

+

notion ThemeIsle Anagram Solver Icons8 Discord Transloadit Ignition Nx HeroCoders Nextbase Starter Kit

## Technology Sponsors diff --git a/docs/package.json b/docs/package.json index 9b254092490..5aa7188e18c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "docs-eslint", "private": true, - "version": "9.0.0-alpha.2", + "version": "9.0.0-beta.1", "description": "", "main": "index.js", "keywords": [], @@ -24,6 +24,7 @@ }, "devDependencies": { "@11ty/eleventy": "^2.0.1", + "@11ty/eleventy-fetch": "^4.0.0", "@11ty/eleventy-img": "^3.1.1", "@11ty/eleventy-navigation": "^0.3.5", "@11ty/eleventy-plugin-rss": "^1.1.1", @@ -48,7 +49,7 @@ "markdown-it-anchor": "^8.1.2", "markdown-it-container": "^3.0.0", "netlify-cli": "^10.3.1", - "npm-run-all": "^4.1.5", + "npm-run-all2": "^5.0.0", "postcss-cli": "^10.0.0", "postcss-html": "^1.5.0", "prismjs": "^1.29.0", diff --git a/docs/src/_data/config.json b/docs/src/_data/config.json index 5f9214a00b8..8ca381bbead 100644 --- a/docs/src/_data/config.json +++ b/docs/src/_data/config.json @@ -1,5 +1,5 @@ { "lang": "en", - "version": "8.56.0", + "version": "8.57.0", "showNextVersion": true } diff --git a/docs/src/_data/eslintNextVersion.js b/docs/src/_data/eslintNextVersion.js new file mode 100644 index 00000000000..d3742364c54 --- /dev/null +++ b/docs/src/_data/eslintNextVersion.js @@ -0,0 +1,32 @@ +/** + * @fileoverview + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const eleventyFetch = require("@11ty/eleventy-fetch"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = async function() { + + // if we're on the next branch, we can just read the package.json file + if (process.env.BRANCH === "next") { + return require("../../package.json").version; + } + + // otherwise, we need to fetch the latest version from the GitHub API + const url = "https://raw.githubusercontent.com/eslint/eslint/next/docs/package.json"; + + const response = await eleventyFetch(url, { + duration: "1d", + type: "json" + }); + + return response.version; +} diff --git a/docs/src/_data/rules.json b/docs/src/_data/rules.json index 90d297ff540..79374b96435 100644 --- a/docs/src/_data/rules.json +++ b/docs/src/_data/rules.json @@ -398,7 +398,7 @@ "description": "Require calls to `isNaN()` when checking for `NaN`", "recommended": true, "fixable": false, - "hasSuggestions": false + "hasSuggestions": true }, { "name": "valid-typeof", diff --git a/docs/src/_data/rules_meta.json b/docs/src/_data/rules_meta.json index 3b8101f1203..647481b3fe5 100644 --- a/docs/src/_data/rules_meta.json +++ b/docs/src/_data/rules_meta.json @@ -2594,6 +2594,7 @@ "fixable": "whitespace" }, "use-isnan": { + "hasSuggestions": true, "type": "problem", "docs": { "description": "Require calls to `isNaN()` when checking for `NaN`", diff --git a/docs/src/_data/sites/en.yml b/docs/src/_data/sites/en.yml index 532630be810..dc90e3dd233 100644 --- a/docs/src/_data/sites/en.yml +++ b/docs/src/_data/sites/en.yml @@ -27,8 +27,9 @@ google_analytics: #------------------------------------------------------------------------------ carbon_ads: - serve: CESDV2QM - placement: eslintorg + serve: "" + placement: "" +ethical_ads: true #------------------------------------------------------------------------------ # Shared diff --git a/docs/src/_includes/components/hero.macro.html b/docs/src/_includes/components/hero.macro.html index 3ff0c9c6f80..5b6ccb38bf4 100644 --- a/docs/src/_includes/components/hero.macro.html +++ b/docs/src/_includes/components/hero.macro.html @@ -22,7 +22,7 @@

{{ params.title }}

{% endif %}
- {% include "partials/carbon-ad.html" %} + {% include "partials/ad.html" %}
diff --git a/docs/src/_includes/components/nav-version-switcher.html b/docs/src/_includes/components/nav-version-switcher.html index a01e5ddf30c..b070e90a954 100644 --- a/docs/src/_includes/components/nav-version-switcher.html +++ b/docs/src/_includes/components/nav-version-switcher.html @@ -14,7 +14,7 @@ {% if config.showNextVersion == true %} - + {% endif %} {% for version in versions.items %} diff --git a/docs/src/_includes/layouts/doc.html b/docs/src/_includes/layouts/doc.html index 58d8986a5dc..92db212806e 100644 --- a/docs/src/_includes/layouts/doc.html +++ b/docs/src/_includes/layouts/doc.html @@ -111,7 +111,7 @@

{{ title }}

{% include 'components/docs-toc.html' %}
diff --git a/docs/src/_includes/partials/carbon-ad.html b/docs/src/_includes/partials/ad.html similarity index 51% rename from docs/src/_includes/partials/carbon-ad.html rename to docs/src/_includes/partials/ad.html index c79eba5a679..e71b3585544 100644 --- a/docs/src/_includes/partials/carbon-ad.html +++ b/docs/src/_includes/partials/ad.html @@ -11,3 +11,15 @@ } {% endif %} +{% if site.ethical_ads %} + +
+{% endif %} \ No newline at end of file diff --git a/docs/src/_includes/partials/versions-list.html b/docs/src/_includes/partials/versions-list.html index 7f07e4fa495..2b859eb9c77 100644 --- a/docs/src/_includes/partials/versions-list.html +++ b/docs/src/_includes/partials/versions-list.html @@ -1,7 +1,7 @@