-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat!: use bundler * Create proud-poems-grin.md * fix
- Loading branch information
Showing
30 changed files
with
332 additions
and
189 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": major | ||
--- | ||
|
||
feat!: use bundler |
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
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,4 @@ | ||
import { buildCjsConfigs } from "./plugin-config-builder" | ||
import { meta, rules, processors, environments } from "./plugin-without-config" | ||
const configs = buildCjsConfigs() | ||
export = { meta, configs, rules, processors, environments } |
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 @@ | ||
import { buildEsmConfigs } from "./plugin-config-builder" | ||
import { meta, rules, processors, environments } from "./plugin-without-config" | ||
const configs = buildEsmConfigs() | ||
export default { meta, configs, rules, processors, environments } | ||
export { meta, configs, rules, processors, environments } |
This file was deleted.
Oops, something went wrong.
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,109 @@ | ||
import base from "./configs/base" | ||
import recommended from "./configs/recommended" | ||
import all from "./configs/all" | ||
import flatBase from "./configs/flat/base" | ||
import flatRecommended from "./configs/flat/recommended" | ||
import flatAll from "./configs/flat/all" | ||
import { buildA11yFlatConfigs, buildA11yLegacyConfigs } from "./a11y" | ||
import type { Linter } from "eslint" | ||
|
||
type ESMConfigs = { | ||
base: Linter.FlatConfig[] | ||
recommended: Linter.FlatConfig[] | ||
all: Linter.FlatConfig[] | ||
"jsx-a11y-strict": Linter.FlatConfig[] | ||
"jsx-a11y-recommended": Linter.FlatConfig[] | ||
// For backward compatibility | ||
"flat/base": Linter.FlatConfig[] | ||
"flat/recommended": Linter.FlatConfig[] | ||
"flat/all": Linter.FlatConfig[] | ||
"flat/jsx-a11y-strict": Linter.FlatConfig[] | ||
"flat/jsx-a11y-recommended": Linter.FlatConfig[] | ||
} | ||
/** | ||
* Build configs for ESM Module | ||
*/ | ||
export function buildEsmConfigs(): ESMConfigs { | ||
const esmConfigs: ESMConfigs = { | ||
base: flatBase as Linter.FlatConfig[], | ||
recommended: flatRecommended as Linter.FlatConfig[], | ||
all: flatAll as Linter.FlatConfig[], | ||
"jsx-a11y-strict": null as never, | ||
"jsx-a11y-recommended": null as never, | ||
// For backward compatibility | ||
"flat/base": flatBase as Linter.FlatConfig[], | ||
"flat/recommended": flatRecommended as Linter.FlatConfig[], | ||
"flat/all": flatAll as Linter.FlatConfig[], | ||
"flat/jsx-a11y-strict": null as never, | ||
"flat/jsx-a11y-recommended": null as never, | ||
} | ||
|
||
const a11yFlatConfigs = buildA11yFlatConfigs() | ||
for (const configName of Object.keys(a11yFlatConfigs)) { | ||
Object.defineProperty(esmConfigs, configName, { | ||
enumerable: true, | ||
get() { | ||
return a11yFlatConfigs[configName] | ||
}, | ||
}) | ||
Object.defineProperty(esmConfigs, `flat/${configName}`, { | ||
enumerable: true, | ||
get() { | ||
return a11yFlatConfigs[configName] | ||
}, | ||
}) | ||
} | ||
|
||
return esmConfigs | ||
} | ||
|
||
type CJSConfigs = { | ||
base: Linter.Config | ||
recommended: Linter.Config | ||
all: Linter.Config | ||
"jsx-a11y-strict": Linter.Config | ||
"jsx-a11y-recommended": Linter.Config | ||
"flat/base": Linter.FlatConfig[] | ||
"flat/recommended": Linter.FlatConfig[] | ||
"flat/all": Linter.FlatConfig[] | ||
"flat/jsx-a11y-strict": Linter.FlatConfig[] | ||
"flat/jsx-a11y-recommended": Linter.FlatConfig[] | ||
} | ||
|
||
/** | ||
* Build configs for CJS Module | ||
*/ | ||
export function buildCjsConfigs(): CJSConfigs { | ||
const cjsConfigs: CJSConfigs = { | ||
base: base as never, | ||
recommended: recommended as Linter.Config, | ||
all: all as Linter.Config, | ||
"jsx-a11y-strict": null as never as Linter.Config, | ||
"jsx-a11y-recommended": null as never as Linter.Config, | ||
"flat/base": flatBase as Linter.FlatConfig[], | ||
"flat/recommended": flatRecommended as Linter.FlatConfig[], | ||
"flat/all": flatAll as Linter.FlatConfig[], | ||
"flat/jsx-a11y-strict": null as never as Linter.FlatConfig[], | ||
"flat/jsx-a11y-recommended": null as never as Linter.FlatConfig[], | ||
} | ||
|
||
const a11yFlatConfigs = buildA11yFlatConfigs() | ||
for (const configName of Object.keys(a11yFlatConfigs)) { | ||
Object.defineProperty(cjsConfigs, `flat/${configName}`, { | ||
enumerable: true, | ||
get() { | ||
return a11yFlatConfigs[configName] | ||
}, | ||
}) | ||
} | ||
const a11yLegacyConfigs = buildA11yLegacyConfigs() | ||
for (const configName of Object.keys(a11yLegacyConfigs)) { | ||
Object.defineProperty(cjsConfigs, configName, { | ||
enumerable: true, | ||
get() { | ||
return a11yLegacyConfigs[configName] | ||
}, | ||
}) | ||
} | ||
return cjsConfigs | ||
} |
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 { rules as ruleList } from "./utils/rules" | ||
import * as processorsDefines from "./processor" | ||
import type { Rule } from "eslint" | ||
|
||
export * as meta from "./meta" | ||
export { environments } from "./environments" | ||
|
||
export const rules = ruleList.reduce( | ||
(obj, r) => { | ||
obj[r.meta.docs.ruleName] = r as never | ||
return obj | ||
}, | ||
{} as { [key: string]: Rule.RuleModule }, | ||
) | ||
|
||
export const processors = { | ||
".astro": processorsDefines.astroProcessor, | ||
astro: processorsDefines.astroProcessor, | ||
"client-side-ts": processorsDefines.clientSideTsProcessor, | ||
} |
Oops, something went wrong.