-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: bump deps * test: update snapshots * chore: babel-eslint to @babel/eslint-parser * feat: support flat config Resolves: #603 * test: add typing tests for flat configs * docs: add flat config example to README * chore: deprecate named export * feat: provide type declaration * 5.0.0-0 * fix: add esm/cjs support * 5.0.0-1 * 5.0.0-2 --------- Co-authored-by: Amila Welihinda <amilajack@gmail.com>
- Loading branch information
Showing
13 changed files
with
3,317 additions
and
4,655 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
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -1,10 +1,33 @@ | ||
// Reconmmended configs for this plugin | ||
export default { | ||
plugins: ["compat"], | ||
env: { | ||
browser: true, | ||
/** | ||
* @file Recommended configs for this plugin | ||
*/ | ||
|
||
import globals from "globals"; | ||
import type { ESLint, Linter } from "eslint"; | ||
|
||
// Flat config: https://eslint.org/docs/latest/use/configure/configuration-files-new | ||
const flat = { | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
"compat/compat": "error", | ||
}, | ||
} satisfies Linter.FlatConfig; | ||
|
||
// eslintrc config: https://eslint.org/docs/latest/use/configure/configuration-files | ||
const legacy = { | ||
env: { | ||
browser: true, | ||
}, | ||
rules: flat.rules, | ||
} satisfies ESLint.ConfigData; | ||
|
||
const recommended = { | ||
flat, | ||
legacy, | ||
}; | ||
|
||
export default recommended; |
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 |
---|---|---|
|
@@ -267,4 +267,4 @@ export default { | |
}, | ||
}; | ||
}, | ||
}; | ||
} as Rule.RuleModule; |
Oops, something went wrong.