-
-
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.
- Loading branch information
1 parent
3a7f95f
commit 12f45f8
Showing
45 changed files
with
672 additions
and
491 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
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.
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,13 +1,10 @@ | ||
import { type Linter } from "@typescript-eslint/utils/ts-eslint"; | ||
import { type FlatConfig } from "@typescript-eslint/utils/ts-eslint"; | ||
|
||
import { rules } from "#eslint-plugin-functional/rules"; | ||
import { ruleNameScope } from "#eslint-plugin-functional/utils/misc"; | ||
|
||
const config: Linter.Config = { | ||
rules: Object.fromEntries( | ||
Object.entries(rules) | ||
.filter(([, rule]) => rule.meta.docs?.requiresTypeChecking === true) | ||
.map(([name]) => [`functional/${name}`, "off"]), | ||
), | ||
}; | ||
|
||
export default config; | ||
export default Object.fromEntries( | ||
Object.entries(rules) | ||
.filter(([, rule]) => rule.meta.docs?.requiresTypeChecking === true) | ||
.map(([name]) => [`${ruleNameScope}/${name}`, "off"]), | ||
) 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,18 +1,13 @@ | ||
import { type Linter } from "@typescript-eslint/utils/ts-eslint"; | ||
import { type FlatConfig } from "@typescript-eslint/utils/ts-eslint"; | ||
|
||
import externalVanillaRecommended from "#eslint-plugin-functional/configs/external-vanilla-recommended"; | ||
import { mergeConfigs } from "#eslint-plugin-functional/utils/merge-configs"; | ||
|
||
const tsConfig: Linter.Config = { | ||
rules: { | ||
"@typescript-eslint/prefer-readonly": "error", | ||
"@typescript-eslint/switch-exhaustiveness-check": "error", | ||
}, | ||
}; | ||
const tsConfig = { | ||
"@typescript-eslint/prefer-readonly": "error", | ||
"@typescript-eslint/switch-exhaustiveness-check": "error", | ||
} satisfies FlatConfig.Config["rules"]; | ||
|
||
const fullConfig: Linter.Config = mergeConfigs( | ||
externalVanillaRecommended, | ||
tsConfig, | ||
); | ||
|
||
export default fullConfig; | ||
export default { | ||
...externalVanillaRecommended, | ||
...tsConfig, | ||
} satisfies FlatConfig.Config["rules"]; |
Oops, something went wrong.