From af33273f153ed173a690a556827c8d1d853b9ac9 Mon Sep 17 00:00:00 2001 From: Carsten Kragelund Date: Sat, 7 Oct 2023 00:01:32 +0200 Subject: [PATCH] feat: move config to package.json --- .eslintrc.cjs | 50 -------------------------------------- package.json | 58 +++++++++++++++++++++++++++++++++++++++++++++ prettier.config.cjs | 7 ------ tsconfig.json | 1 + 4 files changed, 59 insertions(+), 57 deletions(-) delete mode 100644 .eslintrc.cjs delete mode 100644 prettier.config.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index de95c0c..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,50 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - plugins: ["isaacscript", "import"], - extends: [ - "plugin:@typescript-eslint/recommended-type-checked", - "plugin:@typescript-eslint/stylistic-type-checked", - "plugin:prettier/recommended", - ], - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - }, - overrides: [], - rules: { - // These off/not-configured-the-way-we-want lint rules we like & opt into - "@typescript-eslint/no-explicit-any": "error", - // Note: you must disable the base rule as it can report incorrect errors - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - argsIgnorePattern: "^_", - destructuredArrayIgnorePattern: "^_", - varsIgnorePattern: "^_", - ignoreRestSiblings: true, - }, - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { prefer: "type-imports", fixStyle: "inline-type-imports" }, - ], - "import/consistent-type-specifier-style": ["error", "prefer-top-level"], - "@typescript-eslint/consistent-type-definitions": ["error", "type"], - - // For educational purposes we format our comments/jsdoc nicely - "isaacscript/complete-sentences-jsdoc": "warn", - "isaacscript/format-jsdoc-comments": "warn", - - // These lint rules don't make sense for us but are enabled in the preset configs - "@typescript-eslint/no-confusing-void-expression": "off", - "@typescript-eslint/restrict-template-expressions": "off", - - // This rule doesn't seem to be working properly - "@typescript-eslint/prefer-nullish-coalescing": "off", - }, -}; diff --git a/package.json b/package.json index ce77523..d49467f 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,64 @@ "lint": "eslint . --report-unused-disable-directives", "lint:fix": "eslint . --report-unused-disable-directives --fix" }, + "prettier": { + "plugins": [ + "@ianvs/prettier-plugin-sort-imports", + "prettier-plugin-tailwindcss" + ] + }, + "eslintConfig": { + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": [ + "isaacscript", + "import" + ], + "extends": [ + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:@typescript-eslint/stylistic-type-checked", + "plugin:prettier/recommended" + ], + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "project": [ + "./tsconfig.json" + ] + }, + "rules": { + "@typescript-eslint/no-explicit-any": "error", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "prefer": "type-imports", + "fixStyle": "separate-type-imports" + } + ], + "import/consistent-type-specifier-style": [ + "error", + "prefer-top-level" + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "type" + ], + "isaacscript/complete-sentences-jsdoc": "warn", + "isaacscript/format-jsdoc-comments": "warn", + "@typescript-eslint/no-confusing-void-expression": "off", + "@typescript-eslint/restrict-template-expressions": "off" + } + }, "postcss": { "plugins": { "tailwindcss": {} diff --git a/prettier.config.cjs b/prettier.config.cjs deleted file mode 100644 index 800b8a2..0000000 --- a/prettier.config.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import("prettier").Config} */ -module.exports = { - plugins: [ - "@ianvs/prettier-plugin-sort-imports", - "prettier-plugin-tailwindcss", - ], -}; diff --git a/tsconfig.json b/tsconfig.json index c2add4e..ca9dd57 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ "noEmit": true, "composite": true, "strict": true, + "strictNullChecks": true, "downlevelIteration": true, "skipLibCheck": true, "jsx": "react",