feat: Add eslint

This commit is contained in:
Wanjohi
2024-08-30 10:26:36 +03:00
parent fd16947e14
commit 1cef08ebdf
5 changed files with 22 additions and 60 deletions

View File

@@ -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",
},
};

View File

@@ -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,
}
}

View File

@@ -1,8 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Library",
"extends": "./base.json",
"compilerOptions": {
"jsx": "react-jsx"
}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "@nestri/typescript-config/react-library.json",
"extends": "@nestri/typescript-config/base.json",
"compilerOptions": {
"outDir": "dist"
},

View File

@@ -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"]
}