From 1cef08ebdfea119710b0b2a1065c3c6a30882787 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:26:36 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Add=20eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/www/.eslintrc.cjs | 39 ++----------------- packages/typescript-config/base.json | 29 +++++++------- packages/typescript-config/react-library.json | 8 ---- packages/ui/tsconfig.json | 2 +- packages/ui/tsconfig.lint.json | 4 +- 5 files changed, 22 insertions(+), 60 deletions(-) delete mode 100644 packages/typescript-config/react-library.json diff --git a/apps/www/.eslintrc.cjs b/apps/www/.eslintrc.cjs index 70dc5d03..92574ffc 100644 --- a/apps/www/.eslintrc.cjs +++ b/apps/www/.eslintrc.cjs @@ -1,42 +1,11 @@ +/** @type {import("eslint").Linter.Config} */ module.exports = { root: true, - env: { - browser: true, - es2021: true, - node: true, - }, - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:qwik/recommended", - ], + extends: ["@nestri/eslint-config/react-internal.js"], parser: "@typescript-eslint/parser", parserOptions: { + //Find some way to use the lint tsconfig + project: "./tsconfig.json", tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - ecmaVersion: 2021, - sourceType: "module", - ecmaFeatures: { - jsx: true, - }, - }, - plugins: ["@typescript-eslint"], - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/ban-ts-comment": "off", - "prefer-spread": "off", - "no-case-declarations": "off", - "no-console": "off", - "@typescript-eslint/no-unused-vars": ["error"], - "@typescript-eslint/consistent-type-imports": "warn", - "@typescript-eslint/no-unnecessary-condition": "warn", }, }; diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 0f80cfd6..359bdb6e 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -1,20 +1,21 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "display": "Default", "compilerOptions": { - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "incremental": false, - "isolatedModules": true, - "lib": ["es2022", "DOM", "DOM.Iterable"], - "module": "NodeNext", - "moduleDetection": "force", - "moduleResolution": "NodeNext", - "noUncheckedIndexedAccess": true, - "resolveJsonModule": true, - "skipLibCheck": true, + "allowJs": true, + "target": "ES2017", + "module": "ES2022", + "lib": ["es2022", "DOM", "WebWorker", "DOM.Iterable"], + "jsx": "react-jsx", + "jsxImportSource": "@builder.io/qwik", "strict": true, - "target": "ES2022" + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "Bundler", + "esModuleInterop": true, + "skipLibCheck": true, + "incremental": true, + "isolatedModules": true, + "outDir": "tmp", + "noEmit": true, } } diff --git a/packages/typescript-config/react-library.json b/packages/typescript-config/react-library.json deleted file mode 100644 index 44924d9e..00000000 --- a/packages/typescript-config/react-library.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "React Library", - "extends": "./base.json", - "compilerOptions": { - "jsx": "react-jsx" - } -} diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index b3002f02..2f7007fc 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@nestri/typescript-config/react-library.json", + "extends": "@nestri/typescript-config/base.json", "compilerOptions": { "outDir": "dist" }, diff --git a/packages/ui/tsconfig.lint.json b/packages/ui/tsconfig.lint.json index 25daed22..cca55c95 100644 --- a/packages/ui/tsconfig.lint.json +++ b/packages/ui/tsconfig.lint.json @@ -1,8 +1,8 @@ { - "extends": "@nestri/typescript-config/react-library.json", + "extends": "@nestri/typescript-config/base.json", "compilerOptions": { "outDir": "dist" }, - "include": ["src", "tailwind.config.js", "post.config.js"], + "include": ["src", "./*.config.js"], "exclude": ["node_modules", "dist"] }