From 33525977043f5e5d806402a75c61de0da2a25aa7 Mon Sep 17 00:00:00 2001 From: Omar Aziz Date: Sat, 21 Jan 2023 19:35:24 +0000 Subject: [PATCH] add eslint `cache` and import types in config file --- .eslintrc => .eslintrc.cjs | 19 ++++++++++--------- .gitignore | 1 + package.json | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) rename .eslintrc => .eslintrc.cjs (66%) diff --git a/.eslintrc b/.eslintrc.cjs similarity index 66% rename from .eslintrc rename to .eslintrc.cjs index 714491c19c..8706b79af2 100644 --- a/.eslintrc +++ b/.eslintrc.cjs @@ -1,15 +1,16 @@ -{ - "extends": ["eslint-config-unjs"], - "rules": { +/** @type {import('eslint').Linter.Config} */ +module.exports = { + extends: ["eslint-config-unjs"], + rules: { "space-before-function-paren": 0, "arrow-parens": 0, "comma-dangle": 0, - "semi": 0, + semi: 0, "unicorn/prevent-abbreviations": 0, - "quotes": 0, + quotes: 0, "keyword-spacing": 0, "no-undef": 0, - "indent": 0, + indent: 0, "unicorn/catch-error-name": 0, "unicorn/no-null": 0, "unicorn/no-useless-undefined": 0, @@ -17,6 +18,6 @@ "unicorn/no-array-push-push": 0, "unicorn/filename-case": 0, "@typescript-eslint/no-unused-vars": 0, - "@typescript-eslint/no-non-null-assertion": 0 - } -} + "@typescript-eslint/no-non-null-assertion": 0, + }, +}; diff --git a/.gitignore b/.gitignore index 205ed8b8f5..b66ab020d1 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ Temporary Items .netlify .vercel staticwebapp.config.json +.eslintcache \ No newline at end of file diff --git a/package.json b/package.json index 18b6ec169a..43a767d1e1 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "docs:build": "vitepress build docs", "docs:dev": "vitepress dev docs", "docs:serve": "vitepress serve docs", - "lint": "eslint --ext .ts,.mjs,.cjs . && prettier -c src", - "lint:fix": "eslint --fix --ext .ts,.mjs,.cjs . && prettier --write -c src", + "lint": "eslint --cache --ext .ts,.mjs,.cjs . && prettier -c src", + "lint:fix": "eslint --cache --fix --ext .ts,.mjs,.cjs . && prettier --write -c src", "nitro": "jiti ./src/cli.ts", "prepack": "pnpm build", "release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",