0.0.4
This commit is contained in:
parent
cd16119416
commit
18d605339f
12 changed files with 434 additions and 149 deletions
43
règles/unicorn.ts
Normal file
43
règles/unicorn.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import type { Linter } from "eslint";
|
||||
|
||||
import unicorn from "eslint-plugin-unicorn";
|
||||
|
||||
export const règlesUnicorn: Readonly<Linter.Config> = {
|
||||
name: "Unicorn",
|
||||
plugins: { unicorn: unicorn },
|
||||
rules: {
|
||||
...unicorn.configs.unopinionated.rules,
|
||||
/**
|
||||
* Impose un nom de paramètre spécifique dans les clauses de capture des Erreurs.
|
||||
*
|
||||
* @link [GitHub](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md)
|
||||
*/
|
||||
"unicorn/catch-error-name": ["error"],
|
||||
/**
|
||||
* Préfère des types consistants lors de l'étalage d'un tableau de littéraux au sein d'une condition ternaire.
|
||||
*
|
||||
* @link [GitHub](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md)
|
||||
*/
|
||||
"unicorn/consistent-empty-array-spread": ["error"],
|
||||
/**
|
||||
* Impose l'unique manière valide d'étendre la classe `Error`.
|
||||
*
|
||||
* @link [GitHub](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md)
|
||||
*/
|
||||
"unicorn/custom-error-definition": ["error"],
|
||||
/**
|
||||
* Impose la comparaison explicite de propriétés `length` ou `size`. Cela inclut ici l'obligation de vérifier
|
||||
* qu'elles ne correspondent pas à `0` avec `!==`.
|
||||
*
|
||||
* @link [GitHub](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md)
|
||||
*/
|
||||
"unicorn/explicit-length-check": ["error", { "non-zero": "not-equal" }],
|
||||
/**
|
||||
* Interdit l'usage d'opérateurs ternaires imbriqués. Cette règle remplace celle présente par défaut dans _ESLint_
|
||||
* avec le même nom.
|
||||
*
|
||||
* @link [GitHub](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md)
|
||||
*/
|
||||
"unicorn/no-nested-ternary": ["error"],
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue