diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b857d80d..3eba292a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -27,14 +27,14 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} if: ${{ steps.release.outputs.release_created }} - - run: 'npx @humanwhocodes/tweet "eslint-plugin-markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' + - run: 'npx @humanwhocodes/tweet "eslint/markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' if: ${{ steps.release.outputs.release_created }} env: TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - - run: 'npx @humanwhocodes/toot "eslint-plugin-markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' + - run: 'npx @humanwhocodes/toot "eslint/markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' if: ${{ steps.release.outputs.release_created }} env: MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a82eb281..86c14ae1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Code -Please sign the ESLint [Contributor License Agreement](https://cla.js.foundation/eslint/eslint-plugin-markdown) +Please sign the ESLint [Contributor License Agreement](https://eslint.org/cla) ## Full Documentation diff --git a/LICENSE b/LICENSE index cf5a5995..e71a3d8f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright JS Foundation and other contributors, https://js.foundation +Copyright OpenJS Foundation and other contributors, https://openjsf.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 43c1a44c..83049eb4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# eslint-plugin-markdown +# ESLint Markdown Language Plugin -[![npm Version](https://img.shields.io/npm/v/eslint-plugin-markdown.svg)](https://www.npmjs.com/package/eslint-plugin-markdown) -[![Downloads](https://img.shields.io/npm/dm/eslint-plugin-markdown.svg)](https://www.npmjs.com/package/eslint-plugin-markdown) -[![Build Status](https://github.com/eslint/eslint-plugin-markdown/workflows/CI/badge.svg)](https://github.com/eslint/eslint-plugin-markdown/actions) +[![npm Version](https://img.shields.io/npm/v/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown) +[![Downloads](https://img.shields.io/npm/dm/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown) +[![Build Status](https://github.com/eslint/markdown/workflows/CI/badge.svg)](https://github.com/eslint/markdown/actions) Lint JS, JSX, TypeScript, and more inside Markdown. @@ -20,16 +20,16 @@ Lint JS, JSX, TypeScript, and more inside Markdown. Install the plugin alongside ESLint v8 or greater: ```sh -npm install --save-dev eslint eslint-plugin-markdown +npm install --save-dev eslint @eslint/markdown ``` ### Configuring -In your `eslint.config.js` file, import `eslint-plugin-markdown` and include the recommended config to enable the Markdown processor on all `.md` files: +In your `eslint.config.js` file, import `@eslint/markdown` and include the recommended config to enable the Markdown processor on all `.md` files: ```js // eslint.config.js -import markdown from "eslint-plugin-markdown"; +import markdown from "@eslint/markdown"; export default [ ...markdown.configs.recommended @@ -59,7 +59,7 @@ Here's an example: ```js // eslint.config.js -import markdown from "eslint-plugin-markdown"; +import markdown from "@eslint/markdown"; export default [ { @@ -102,7 +102,7 @@ Use glob patterns to disable more rules just for Markdown code blocks: ```js // / eslint.config.js -import markdown from "eslint-plugin-markdown"; +import markdown from "@eslint/markdown"; export default [ { @@ -271,15 +271,15 @@ console.log("This code block is linted normally."); The [`linter-eslint`](https://atom.io/packages/linter-eslint) package allows for linting within the [Atom IDE](https://atom.io/). -In order to see `eslint-plugin-markdown` work its magic within Markdown code blocks in your Atom editor, you can go to `linter-eslint`'s settings and within "List of scopes to run ESLint on...", add the cursor scope "source.gfm". +In order to see `@eslint/markdown` work its magic within Markdown code blocks in your Atom editor, you can go to `linter-eslint`'s settings and within "List of scopes to run ESLint on...", add the cursor scope "source.gfm". -However, this reports a problem when viewing Markdown which does not have configuration, so you may wish to use the cursor scope "source.embedded.js", but note that `eslint-plugin-markdown` configuration comments and skip directives won't work in this context. +However, this reports a problem when viewing Markdown which does not have configuration, so you may wish to use the cursor scope "source.embedded.js", but note that `@eslint/markdown` configuration comments and skip directives won't work in this context. ## Contributing ```sh -$ git clone https://github.com/eslint/eslint-plugin-markdown.git -$ cd eslint-plugin-markdown +$ git clone https://github.com/eslint/markdown.git +$ cd markdown $ npm install $ npm test ``` diff --git a/eslint.config.js b/eslint.config.js index dae8360f..fc7ea9ae 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,7 +15,8 @@ export default [ ignores: [ "**/examples", "**/coverage", - "**/tests/fixtures" + "**/tests/fixtures", + "dist" ] }, { diff --git a/examples/react/README.md b/examples/react/README.md index dec0abfa..42adcd16 100644 --- a/examples/react/README.md +++ b/examples/react/README.md @@ -11,13 +11,13 @@ function App({ name }) { ``` ```sh -$ git clone https://github.com/eslint/eslint-plugin-markdown.git -$ cd eslint-plugin-markdown +$ git clone https://github.com/eslint/markdown.git +$ cd markdown $ npm install $ cd examples/react $ npm test -eslint-plugin-markdown/examples/react/README.md +markdown/examples/react/README.md 4:16 error 'name' is missing in props validation react/prop-types ✖ 1 problem (1 error, 0 warnings) diff --git a/examples/typescript/README.md b/examples/typescript/README.md index 7d2fc53c..55673a5c 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -11,13 +11,13 @@ hello(42 as any); ``` ```sh -$ git clone https://github.com/eslint/eslint-plugin-markdown.git -$ cd eslint-plugin-markdown +$ git clone https://github.com/eslint/markdown.git +$ cd markdown $ npm install $ cd examples/typescript $ npm test -eslint-plugin-markdown/examples/typescript/README.md +markdown/examples/typescript/README.md 6:22 error Prefer using the primitive `string` as a type name, rather than the upper-cased `String` @typescript-eslint/no-wrapper-object-types 10:13 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any diff --git a/package.json b/package.json index 655f84a4..e2479d74 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "eslint-plugin-markdown", + "name": "@eslint/markdown", "version": "5.1.0", - "description": "An ESLint plugin to lint JavaScript in Markdown code fences.", + "description": "The official ESLint language plugin for Markdown", "license": "MIT", "author": { "name": "Brandon Mills", @@ -17,11 +17,14 @@ "files": [ "src" ], - "repository": "eslint/eslint-plugin-markdown", + "publishConfig": { + "access": "public" + }, + "repository": "eslint/markdown", "bugs": { - "url": "https://github.com/eslint/eslint-plugin-markdown/issues" + "url": "https://github.com/eslint/markdown/issues" }, - "homepage": "https://github.com/eslint/eslint-plugin-markdown#readme", + "homepage": "https://github.com/eslint/markdown#readme", "keywords": [ "eslint", "eslintplugin", @@ -32,11 +35,6 @@ "scripts": { "lint": "eslint .", "prepare": "node ./npm-prepare.cjs", - "release:generate:latest": "eslint-generate-release", - "release:generate:alpha": "eslint-generate-prerelease alpha", - "release:generate:beta": "eslint-generate-prerelease beta", - "release:generate:rc": "eslint-generate-prerelease rc", - "release:publish": "eslint-publish-release", "test": "c8 mocha \"tests/**/*.test.js\" --timeout 30000" }, "devDependencies": { @@ -46,7 +44,6 @@ "chai": "^5.1.1", "eslint": "^9.4.0", "eslint-config-eslint": "^11.0.0", - "eslint-release": "^3.1.2", "globals": "^15.1.0", "mocha": "^10.6.0" }, diff --git a/src/index.js b/src/index.js index 5c375274..7de920c2 100644 --- a/src/index.js +++ b/src/index.js @@ -3,8 +3,16 @@ * @author Brandon Mills */ +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + import { processor } from "./processor.js"; +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + const rulesConfig = { // The Markdown parser automatically trims trailing @@ -30,7 +38,7 @@ const rulesConfig = { const plugin = { meta: { - name: "eslint-plugin-markdown", + name: "@eslint/markdown", version: "5.1.0" // x-release-please-version }, processors: { diff --git a/src/processor.js b/src/processor.js index 43fa6618..7712d373 100644 --- a/src/processor.js +++ b/src/processor.js @@ -409,7 +409,7 @@ function postprocess(messages, filename) { export const processor = { meta: { - name: "eslint-plugin-markdown/markdown", + name: "@eslint/markdown/markdown", version: "5.1.0" // x-release-please-version }, preprocess, diff --git a/tests/plugin.test.js b/tests/plugin.test.js index 94edb62c..15c2b288 100644 --- a/tests/plugin.test.js +++ b/tests/plugin.test.js @@ -69,7 +69,7 @@ function initFlatESLint(fixtureConfigName, options = {}) { describe("meta", () => { it("should export meta property", () => { - assert.deepStrictEqual(plugin.meta, { name: "eslint-plugin-markdown", version: pkg.version }); + assert.deepStrictEqual(plugin.meta, { name: "@eslint/markdown", version: pkg.version }); }); }); @@ -165,7 +165,7 @@ describe("LegacyESLint", () => { assert.strictEqual(results[0].messages[1].endLine, 8); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/77 + // https://github.com/eslint/markdown/issues/77 it("should emit correct line numbers with leading blank line", async () => { const code = [ "### Heading", @@ -277,7 +277,7 @@ describe("LegacyESLint", () => { assert.strictEqual(results[0].messages[4].column, 2); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/181 + // https://github.com/eslint/markdown/issues/181 it("should work when called on nested code blocks in the same file", async () => { /* @@ -350,7 +350,7 @@ describe("LegacyESLint", () => { assert.strictEqual(results[0].messages[3].line, 15); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/78 + // https://github.com/eslint/markdown/issues/78 it("preserves leading empty lines", async () => { const code = [ "", @@ -1127,7 +1127,7 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].messages[1].endLine, 8); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/77 + // https://github.com/eslint/markdown/issues/77 it("should emit correct line numbers with leading blank line", async () => { const code = [ "### Heading", @@ -1239,7 +1239,7 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].messages[4].column, 2); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/181 + // https://github.com/eslint/markdown/issues/181 it("should work when called on nested code blocks in the same file", async () => { /* @@ -1312,7 +1312,7 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].messages[3].line, 15); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/78 + // https://github.com/eslint/markdown/issues/78 it("preserves leading empty lines", async () => { const code = [ "", diff --git a/tests/processor.test.js b/tests/processor.test.js index bb00eb33..d7d9dc65 100644 --- a/tests/processor.test.js +++ b/tests/processor.test.js @@ -30,7 +30,7 @@ describe("processor", () => { describe("meta", () => { it("should have meta property", () => { - assert.deepStrictEqual(processor.meta, { name: "eslint-plugin-markdown/markdown", version: pkg.version }); + assert.deepStrictEqual(processor.meta, { name: "@eslint/markdown/markdown", version: pkg.version }); }); }); @@ -504,7 +504,7 @@ describe("processor", () => { ].join("\n")); }); - // https://github.com/eslint/eslint-plugin-markdown/issues/76 + // https://github.com/eslint/markdown/issues/76 it("should insert comments inside list items", () => { const code = [ "* List item followed by a blank line",