Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
132 additions
and
26 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-svelte": 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 "yarn update" | ||
export const name = "eslint-plugin-svelte" as const | ||
export const version = "2.27.4" 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,21 @@ | ||
import assert from "assert" | ||
import plugin from "../../src" | ||
import { version } from "../../package.json" | ||
const expectedMeta = { | ||
name: "eslint-plugin-svelte", | ||
version, | ||
} | ||
|
||
describe("Test for meta object", () => { | ||
it("A plugin should have a meta object.", () => { | ||
assert.strictEqual(plugin.meta.name, expectedMeta.name) | ||
assert.strictEqual(typeof plugin.meta.version, "string") | ||
}) | ||
|
||
for (const [name, processor] of Object.entries(plugin.processors)) { | ||
it(`"${name}" processor should have a meta object.`, () => { | ||
assert.strictEqual(processor.meta.name, expectedMeta.name) | ||
assert.strictEqual(typeof processor.meta.version, "string") | ||
}) | ||
} | ||
}) |
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,38 @@ | ||
import fs from "fs" | ||
import path from "path" | ||
import { ESLint } from "eslint" | ||
import { name, version } from "../package.json" | ||
import { getNewVersion } from "./lib/changesets-util" | ||
|
||
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 eslint = new ESLint({ fix: true }) | ||
const [result] = await eslint.lintText( | ||
`/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "yarn update" | ||
*/ | ||
export const name = ${JSON.stringify(name)} as const; | ||
export const version = ${JSON.stringify(await getVersion())} as const; | ||
`, | ||
{ filePath: META_PATH }, | ||
) | ||
fs.writeFileSync(META_PATH, result.output!, "utf8") | ||
} | ||
|
||
/** 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
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