-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: migrate to TypeScript and ESM #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9281c2e
1309a6b
0f4bdc9
a326c3a
b931460
70b63c0
060a654
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ | |
| /node_modules | ||
| /npm-debug.log | ||
| /test.js | ||
| dist/ | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import type { ESLint, Linter, Rule } from "eslint" | ||
| import { rulesRecommended } from "./lib/configs/recommended.ts" | ||
| import { rules } from "./lib/rules.ts" | ||
| import packageJson from "./package.json" with { type: "json" } | ||
|
|
||
| const plugin: { | ||
| meta: { | ||
| name: string | ||
| version: string | ||
| } | ||
| rules: { | ||
| "disable-enable-pair": Rule.RuleModule | ||
| "no-aggregating-enable": Rule.RuleModule | ||
| "no-duplicate-disable": Rule.RuleModule | ||
| "no-restricted-disable": Rule.RuleModule | ||
| "no-unlimited": Rule.RuleModule | ||
| "no-unused-disable": Rule.RuleModule | ||
| "no-unused-enable": Rule.RuleModule | ||
| "no-use": Rule.RuleModule | ||
| "require-description": Rule.RuleModule | ||
| } | ||
|
Comment on lines
+7
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this type annotation needed when you're using |
||
| } = { | ||
| meta: { | ||
| name: packageJson.name, | ||
| version: packageJson.version, | ||
| }, | ||
| rules, | ||
| } as const satisfies ESLint.Plugin | ||
|
|
||
| export const recommended: { | ||
| name: "@eslint-community/eslint-comments/recommended" | ||
| plugins: { | ||
| "@eslint-community/eslint-comments": { | ||
| meta: { | ||
| name: string | ||
| version: string | ||
| } | ||
| rules: { | ||
| "disable-enable-pair": Rule.RuleModule | ||
| "no-aggregating-enable": Rule.RuleModule | ||
| "no-duplicate-disable": Rule.RuleModule | ||
| "no-restricted-disable": Rule.RuleModule | ||
| "no-unlimited": Rule.RuleModule | ||
| "no-unused-disable": Rule.RuleModule | ||
| "no-unused-enable": Rule.RuleModule | ||
| "no-use": Rule.RuleModule | ||
| "require-description": Rule.RuleModule | ||
| } | ||
| } | ||
| } | ||
| rules: { | ||
| "@eslint-community/eslint-comments/disable-enable-pair": "error" | ||
| "@eslint-community/eslint-comments/no-aggregating-enable": "error" | ||
| "@eslint-community/eslint-comments/no-duplicate-disable": "error" | ||
| "@eslint-community/eslint-comments/no-unlimited-disable": "error" | ||
| "@eslint-community/eslint-comments/no-unused-enable": "error" | ||
| } | ||
|
Comment on lines
+31
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question here. Why is |
||
| } = { | ||
| name: "@eslint-community/eslint-comments/recommended", | ||
| plugins: { | ||
| "@eslint-community/eslint-comments": plugin, | ||
| }, | ||
| rules: rulesRecommended, | ||
| } as const satisfies Linter.FlatConfig | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export * as configs from "./lib/configs.ts" | ||
| export { rules } from "./lib/rules.ts" | ||
| export * as utils from "./lib/utils.ts" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * as recommended from "./configs/recommended.ts" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { BaseConfig, RulesConfig } from "@eslint/core" | ||
| import type { Linter } from "eslint" | ||
|
|
||
| export const plugins: string[] = [ | ||
| "@eslint-community/eslint-comments", | ||
| ] as const satisfies BaseConfig["plugins"] | ||
|
|
||
| export const rulesRecommended: { | ||
| "@eslint-community/eslint-comments/disable-enable-pair": "error" | ||
| "@eslint-community/eslint-comments/no-aggregating-enable": "error" | ||
| "@eslint-community/eslint-comments/no-duplicate-disable": "error" | ||
| "@eslint-community/eslint-comments/no-unlimited-disable": "error" | ||
| "@eslint-community/eslint-comments/no-unused-enable": "error" | ||
| } = { | ||
| "@eslint-community/eslint-comments/disable-enable-pair": "error", | ||
| "@eslint-community/eslint-comments/no-aggregating-enable": "error", | ||
| "@eslint-community/eslint-comments/no-duplicate-disable": "error", | ||
| "@eslint-community/eslint-comments/no-unlimited-disable": "error", | ||
| "@eslint-community/eslint-comments/no-unused-enable": "error", | ||
| } as const satisfies Linter.RulesRecord satisfies RulesConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing these entries from the CI matrix, when the engines list haven't been reduced is creating a blind spot. Is there a reason these versions were dropped?