From 7584d2d7a7110aef0331ebfa178b2295842c59fa Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:19:14 -0700 Subject: refactor: project maintenance - work in progress --- .eslintrc.cjs | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .eslintrc.cjs (limited to '.eslintrc.cjs') diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..2be48ef --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,89 @@ +/** @type {import('eslint').Linter.Config} */ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: './tsconfig.json', + }, + ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'], + extends: ['@adonisjs/eslint-config/app', 'plugin:unicorn/recommended', 'prettier'], + plugins: ['@adonisjs/eslint-plugin'], + env: { + es6: true, + node: true, + }, + reportUnusedDisableDirectives: true, + overrides: [ + { + files: ['**/*.ts'], + extends: [ + '@adonisjs/eslint-config/app', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/strict', + // TODO: Opt-in to a stricter ruleset in the future + // 'plugin:@typescript-eslint/strict-type-checked', + 'plugin:@typescript-eslint/stylistic-type-checked', + 'plugin:import/typescript', + ], + parser: '@typescript-eslint/parser', + plugins: [], + rules: { + // eslint + 'max-len': 0, + + // @typescript-eslint + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/no-empty-interface': 0, + '@typescript-eslint/semi': 0, + '@typescript-eslint/space-before-function-paren': 0, + '@typescript-eslint/no-extraneous-class': 0, + '@typescript-eslint/ban-ts-comment': 0, + '@typescript-eslint/prefer-ts-expect-error': 0, + '@typescript-eslint/explicit-member-accessibility': 0, + '@typescript-eslint/no-shadow': 0, + '@typescript-eslint/prefer-nullish-coalescing': 0, + + // @adonisjs/eslint-plugin + '@adonisjs/prefer-lazy-controller-import': 2, + '@adonisjs/prefer-lazy-listener-import': 2, + + // eslint-plugin-unicorn + 'unicorn/filename-case': 0, + }, + }, + ], + rules: { + // eslint + 'array-callback-return': 1, + 'consistent-return': 1, + 'max-len': 0, + 'no-await-in-loop': 1, + 'no-return-assign': 1, + 'no-console': [ + 1, + { + allow: ['warn', 'error'], + }, + ], + 'no-param-reassign': 1, + 'prefer-destructuring': 1, + // eslint-plugin-unicorn + 'unicorn/filename-case': 0, + 'unicorn/prefer-module': 0, + 'unicorn/prevent-abbreviations': 0, + + 'unicorn/import-style': [ + 2, + { + styles: { + path: { + named: true, + }, + }, + }, + ], + 'unicorn/no-empty-file': 0, + 'unicorn/prefer-top-level-await': 0, + }, +} -- cgit v1.2.3-70-g09d2