From d6ef239f5654304e33988f1bd0f41b5b5283b2cb Mon Sep 17 00:00:00 2001 From: Nerivec <62446222+Nerivec@users.noreply.github.com> Date: Mon, 18 Nov 2024 20:53:35 +0100 Subject: [PATCH] fix: Update config to recommended (#605) --- .prettierrc | 26 -------------------------- eslint.config.mjs | 8 +++++--- prettier.config.mjs | 28 ++++++++++++++++++++++++++++ tests/tsconfig.json | 2 +- tsconfig.json | 24 ++++++++++++------------ 5 files changed, 46 insertions(+), 42 deletions(-) delete mode 100644 .prettierrc create mode 100644 prettier.config.mjs diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d8de3f26..00000000 --- a/.prettierrc +++ /dev/null @@ -1,26 +0,0 @@ -{ - "semi": true, - "trailingComma": "all", - "singleQuote": true, - "printWidth": 150, - "bracketSpacing": false, - "endOfLine": "lf", - "tabWidth": 4, - "importOrder": [ - "", - "^(node:)", - "", - "", - "", - "^[.]", - "", - "", - "", - "", - "", - "^zigbee", - "", - "^[.]" - ], - "plugins": ["@ianvs/prettier-plugin-sort-imports"] -} diff --git a/eslint.config.mjs b/eslint.config.mjs index 6e81d90a..82545334 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -6,12 +6,14 @@ export default tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, { - files: ['**/*.ts', '**/*.tsx'], + files: ['**/*.ts'], languageOptions: { ecmaVersion: 'latest', sourceType: 'script', parserOptions: { - project: true, + projectService: { + allowDefaultProject: ['eslint.config.mjs', 'prettier.config.mjs'], + }, }, }, rules: { @@ -27,7 +29,7 @@ export default tseslint.config( }, }, { - ignores: ['tmp/', 'dist/', 'eslint.config.mjs'], + ignores: ['tmp', 'dist', 'coverage'], }, eslintConfigPrettier, ); diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 00000000..c8df44dd --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,28 @@ +import sortImports from '@ianvs/prettier-plugin-sort-imports'; + +export default { + plugins: [sortImports], + semi: true, + trailingComma: 'all', + singleQuote: true, + printWidth: 150, + bracketSpacing: false, + endOfLine: 'lf', + tabWidth: 4, + importOrder: [ + '', + '^(node:)', + '', + '', + '', + '^[.]', + '', + '', + '', + '', + '', + '^zigbee', + '', + '^[.]', + ], +}; diff --git a/tests/tsconfig.json b/tests/tsconfig.json index c2c9992f..c0ec8c5c 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../tsconfig", - "include": ["./**/*", "./jest.config.ts"], + "include": ["./**/*", "jest.config.ts"], "compilerOptions": { "types": ["jest"], "rootDir": "..", diff --git a/tsconfig.json b/tsconfig.json index aa8afcbf..2c7e760f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,20 @@ { "compilerOptions": { - "strict": true, - "declaration": true, - "module": "ES2022", - "moduleResolution": "node", - "target": "ES2022", - "lib": ["ES2022"], - "outDir": "dist", "rootDir": "src", - "noUnusedLocals": true, + "outDir": "dist", + "module": "ESNext", + "moduleResolution": "node10", + "target": "ESNext", + "lib": ["ESNext"], "esModuleInterop": true, - "noImplicitAny": true, - "noImplicitThis": true, - "composite": true + "declaration": true, + "declarationMap": true, + "strict": true, + "noUnusedLocals": true, + "composite": true, + "checkJs": true }, - "include": ["./src/**/*", "./eslint.config.mjs"], + "include": ["./src/**/*"], "ts-node": { "esm": true }