From 199c091c9342a3c638d234b896bd8af98f73d5b2 Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Fri, 1 Apr 2022 13:35:13 -0500 Subject: [PATCH] Enable new ESLint rules (#13) --- .changeset/slow-avocados-shave.md | 18 ++++++++++++++++++ packages/eslint-config-widen/src/index.ts | 12 +++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .changeset/slow-avocados-shave.md diff --git a/.changeset/slow-avocados-shave.md b/.changeset/slow-avocados-shave.md new file mode 100644 index 0000000..19df6a4 --- /dev/null +++ b/.changeset/slow-avocados-shave.md @@ -0,0 +1,18 @@ +--- +'eslint-config-widen': minor +--- + +Enable a number of new ESLint rules: + +- [camelcase](https://eslint.org/docs/rules/camelcase) +- [default-param-last](https://eslint.org/docs/rules/default-param-last) +- [dot-notation](https://eslint.org/docs/rules/dot-notation) +- [no-console](https://eslint.org/docs/rules/no-console) +- [no-else-return](https://eslint.org/docs/rules/no-else-return) +- [no-empty](https://eslint.org/docs/rules/no-empty) +- [no-param-reassign](https://eslint.org/docs/rules/no-param-reassign) +- [no-return-await](https://eslint.org/docs/rules/no-return-await) +- [no-template-curly-in-string](https://eslint.org/docs/rules/no-template-curly-in-string) +- [no-unneeded-ternary](https://eslint.org/docs/rules/no-unneeded-ternary) +- [no-useless-computed-key](https://eslint.org/docs/rules/no-useless-computed-key) +- [require-await](https://eslint.org/docs/rules/require-await) diff --git a/packages/eslint-config-widen/src/index.ts b/packages/eslint-config-widen/src/index.ts index fad3677..afc624e 100644 --- a/packages/eslint-config-widen/src/index.ts +++ b/packages/eslint-config-widen/src/index.ts @@ -12,6 +12,9 @@ export = { }, plugins: ['widen'], rules: { + camelcase: 'warn', + 'default-param-last': 'error', + 'dot-notation': 'error', eqeqeq: [ 'error', 'always', @@ -19,10 +22,15 @@ export = { null: 'ignore', }, ], - 'no-console': 'off', + 'no-console': ['error', { allow: ['error'] }], 'no-dupe-args': 'error', 'no-duplicate-imports': 'error', + 'no-else-return': 'error', + 'no-empty': ['error', { allowEmptyCatch: true }], 'no-extra-bind': 'error', + 'no-param-reassign': 'error', + 'no-return-await': 'error', + 'no-template-curly-in-string': 'error', 'no-unneeded-ternary': 'error', 'no-unused-expressions': 'off', 'no-unused-vars': [ @@ -32,6 +40,7 @@ export = { varsIgnorePattern: '^_', }, ], + 'no-useless-computed-key': 'error', 'no-var': 'error', 'object-shorthand': 'error', 'prefer-const': [ @@ -40,6 +49,7 @@ export = { destructuring: 'all', }, ], + 'require-await': 'error', 'sort/exports': [ 'warn', {