-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: export meta object * Create purple-countries-cough.md
- Loading branch information
Showing
19 changed files
with
120 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-astro": minor | ||
--- | ||
|
||
feat: export meta object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// IMPORTANT! | ||
// This file has been automatically generated, | ||
// in order to update its content execute "npm run update" | ||
export const name = "eslint-plugin-astro" as const | ||
export const version = "0.26.2" as const |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import assert from "assert" | ||
import plugin from "../../src" | ||
import { version } from "../../package.json" | ||
const expectedMeta = { | ||
name: "eslint-plugin-astro", | ||
version, | ||
} | ||
|
||
describe("Test for meta object", () => { | ||
it("A plugin should have a meta object.", () => { | ||
assert.deepStrictEqual(plugin.meta, expectedMeta) | ||
}) | ||
|
||
for (const [name, processor] of Object.entries(plugin.processors)) { | ||
it(`"${name}" processor should have a meta object.`, () => { | ||
// @ts-expect-error -- missing type | ||
assert.deepStrictEqual(processor.meta, expectedMeta) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import fs from "fs" | ||
import path from "path" | ||
import { name, version } from "../package.json" | ||
import { getNewVersion } from "./lib/changesets-util" | ||
import { formatAndSave } from "./lib/utils" | ||
|
||
const META_PATH = path.join(__dirname, "../src/meta.ts") | ||
|
||
void main() | ||
|
||
/** main */ | ||
async function main() { | ||
if (!fs.existsSync(META_PATH)) { | ||
fs.writeFileSync(META_PATH, "", "utf8") | ||
} | ||
const code = `/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
export const name = ${JSON.stringify(name)} as const; | ||
export const version = ${JSON.stringify(await getVersion())} as const; | ||
` | ||
await formatAndSave(META_PATH, code) | ||
} | ||
|
||
/** Get version */ | ||
function getVersion() { | ||
// eslint-disable-next-line no-process-env -- ignore | ||
if (process.env.IN_VERSION_CI_SCRIPT) { | ||
return getNewVersion() | ||
} | ||
return version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters