-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for flat configs (#789)
* feat: add support for flat configs * ci: fix release replacements * chore(release): 6.2.0-next.1 [skip ci] # [6.2.0-next.1](v6.1.1...v6.2.0-next.1) (2024-03-13) ### Features * add support for flat configs ([901d52a](901d52a)) * fix: build types * fix: improve types * chore(release): 6.2.0-next.2 [skip ci] # [6.2.0-next.2](v6.2.0-next.1...v6.2.0-next.2) (2024-03-14) ### Bug Fixes * build types ([054a862](054a862)) * improve types ([2340489](2340489)) * feat: move flat configs to new "flat" subpackage * ci: fix release * chore(release): 6.2.0-next.3 [skip ci] # [6.2.0-next.3](v6.2.0-next.2...v6.2.0-next.3) (2024-03-14) ### Features * move flat configs to new "flat" subpackage ([1d3533f](1d3533f)) --------- Co-authored-by: semantic-release-bot <[email protected]>
- Loading branch information
1 parent
5fc52d1
commit 5fa7c2c
Showing
57 changed files
with
821 additions
and
545 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,45 +1,15 @@ | ||
import { type Linter } from "@typescript-eslint/utils/ts-eslint"; | ||
import { type FlatConfig } from "@typescript-eslint/utils/ts-eslint"; | ||
|
||
import * as functionalParameters from "#eslint-plugin-functional/rules/functional-parameters"; | ||
import * as immutableData from "#eslint-plugin-functional/rules/immutable-data"; | ||
import * as noClasses from "#eslint-plugin-functional/rules/no-classes"; | ||
import * as noConditionalStatements from "#eslint-plugin-functional/rules/no-conditional-statements"; | ||
import * as noExpressionStatements from "#eslint-plugin-functional/rules/no-expression-statements"; | ||
import * as noLet from "#eslint-plugin-functional/rules/no-let"; | ||
import * as noLoopStatements from "#eslint-plugin-functional/rules/no-loop-statements"; | ||
import * as noMixedTypes from "#eslint-plugin-functional/rules/no-mixed-types"; | ||
import * as noPromiseReject from "#eslint-plugin-functional/rules/no-promise-reject"; | ||
import * as noReturnVoid from "#eslint-plugin-functional/rules/no-return-void"; | ||
import * as noThisExpressions from "#eslint-plugin-functional/rules/no-this-expressions"; | ||
import * as noThrowStatements from "#eslint-plugin-functional/rules/no-throw-statements"; | ||
import * as noTryStatements from "#eslint-plugin-functional/rules/no-try-statements"; | ||
import * as preferImmutableTypes from "#eslint-plugin-functional/rules/prefer-immutable-types"; | ||
import * as preferPropertySignatures from "#eslint-plugin-functional/rules/prefer-property-signatures"; | ||
import * as preferTacit from "#eslint-plugin-functional/rules/prefer-tacit"; | ||
import * as readonlyType from "#eslint-plugin-functional/rules/readonly-type"; | ||
import * as typeDeclarationImmutability from "#eslint-plugin-functional/rules/type-declaration-immutability"; | ||
import { rules } from "#eslint-plugin-functional/rules"; | ||
import { ruleNameScope } from "#eslint-plugin-functional/utils/misc"; | ||
|
||
const config: Linter.Config = { | ||
rules: { | ||
[`functional/${functionalParameters.name}`]: "error", | ||
[`functional/${immutableData.name}`]: "error", | ||
[`functional/${noClasses.name}`]: "error", | ||
[`functional/${noConditionalStatements.name}`]: "error", | ||
[`functional/${noExpressionStatements.name}`]: "error", | ||
[`functional/${noLet.name}`]: "error", | ||
[`functional/${noLoopStatements.name}`]: "error", | ||
[`functional/${noMixedTypes.name}`]: "error", | ||
[`functional/${noPromiseReject.name}`]: "error", | ||
[`functional/${noReturnVoid.name}`]: "error", | ||
[`functional/${noThisExpressions.name}`]: "error", | ||
[`functional/${noThrowStatements.name}`]: "error", | ||
[`functional/${noTryStatements.name}`]: "error", | ||
[`functional/${preferImmutableTypes.name}`]: "error", | ||
[`functional/${preferPropertySignatures.name}`]: "error", | ||
[`functional/${preferTacit.name}`]: "warn", | ||
[`functional/${readonlyType.name}`]: "error", | ||
[`functional/${typeDeclarationImmutability.name}`]: "error", | ||
}, | ||
}; | ||
|
||
export default config; | ||
export default { | ||
...Object.fromEntries( | ||
Object.entries(rules) | ||
.filter(([, rule]) => rule.meta.deprecated !== true) | ||
.map(([name, rule]) => [ | ||
`${ruleNameScope}/${name}`, | ||
rule.meta.docs.recommendedSeverity, | ||
]), | ||
), | ||
} satisfies FlatConfig.Config["rules"]; |
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,11 +1,18 @@ | ||
import { type Linter } from "@typescript-eslint/utils/ts-eslint"; | ||
import { type FlatConfig } from "@typescript-eslint/utils/ts-eslint"; | ||
|
||
import * as functionalParameters from "#eslint-plugin-functional/rules/functional-parameters"; | ||
import { rules } from "#eslint-plugin-functional/rules"; | ||
import { ruleNameScope } from "#eslint-plugin-functional/utils/misc"; | ||
|
||
const config: Linter.Config = { | ||
rules: { | ||
[`functional/${functionalParameters.name}`]: "error", | ||
}, | ||
}; | ||
|
||
export default config; | ||
export default Object.fromEntries( | ||
Object.entries(rules) | ||
.filter( | ||
([, rule]) => | ||
rule.meta.deprecated !== true && | ||
rule.meta.docs.category === "Currying" && | ||
rule.meta.docs.recommended !== false, | ||
) | ||
.map(([name, rule]) => [ | ||
`${ruleNameScope}/${name}`, | ||
rule.meta.docs.recommendedSeverity, | ||
]), | ||
) satisfies FlatConfig.Config["rules"]; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.