diff options
Diffstat (limited to '')
-rw-r--r-- | src/packages/eslint-config/eslint.library.config.js | 39 | ||||
-rw-r--r-- | src/packages/eslint-config/library.js | 34 | ||||
-rw-r--r-- | src/packages/eslint-config/package.json | 10 |
3 files changed, 46 insertions, 37 deletions
diff --git a/src/packages/eslint-config/eslint.library.config.js b/src/packages/eslint-config/eslint.library.config.js new file mode 100644 index 0000000..e3c7866 --- /dev/null +++ b/src/packages/eslint-config/eslint.library.config.js @@ -0,0 +1,39 @@ +// @ts-check + +import globals from "globals"; +import eslint from "@eslint/js"; +import ts from "typescript-eslint"; +import prettier from "eslint-config-prettier"; +import turboPlugin from "eslint-plugin-turbo"; + +import { resolve } from "node:path"; + +const project = resolve(process.cwd(), "tsconfig.json"); + +export default ts.config( + eslint.configs.recommended, + ...ts.configs.recommended, + prettier, + { + name: "eslint-config-turbo (recreated flat)", + plugins: { + turbo: { rules: turboPlugin.rules }, + }, + rules: { + "turbo/no-undeclared-env-vars": "error", + }, + }, + { + name: "library", + languageOptions: { + // parserOptions: { + // project: resolve(process.cwd(), "tsconfig.json") + // }, + globals: { + ...globals.browser, + ...globals.node, + }, + }, + ignores: ["build/", ".svelte-kit/", "dist/"], + }, +); diff --git a/src/packages/eslint-config/library.js b/src/packages/eslint-config/library.js deleted file mode 100644 index 9b59cc0..0000000 --- a/src/packages/eslint-config/library.js +++ /dev/null @@ -1,34 +0,0 @@ -const { resolve } = require("node:path"); - -const project = resolve(process.cwd(), "tsconfig.json"); - -/** @type {import("eslint").Linter.Config} */ -module.exports = { - extends: ["eslint:recommended", "prettier", "turbo"], - plugins: ["only-warn"], - globals: { - React: true, - JSX: true, - }, - env: { - node: true, - }, - settings: { - "import/resolver": { - typescript: { - project, - }, - }, - }, - ignorePatterns: [ - // Ignore dotfiles - ".*.js", - "node_modules/", - "dist/", - ], - overrides: [ - { - files: ["*.js?(x)", "*.ts?(x)"], - }, - ], -}; diff --git a/src/packages/eslint-config/package.json b/src/packages/eslint-config/package.json index ba005cf..a05970f 100644 --- a/src/packages/eslint-config/package.json +++ b/src/packages/eslint-config/package.json @@ -3,15 +3,19 @@ "version": "0.0.0", "devDependencies": { "@typescript-eslint/eslint-plugin": "8.12.2", - "@typescript-eslint/parser": "8.12.2", "@vercel/style-guide": "6.0.0", + "@types/eslint": "^9.6.0", + "eslint": "^9.7.0", "eslint-config-prettier": "^9.1.0", "eslint-config-turbo": "^2.2.3", "eslint-plugin-only-warn": "^1.1.0", - "typescript": "^5.6.3" + "globals": "^15.0.0", + "typescript": "^5.6.3", + "typescript-eslint": "^8.0.0" }, "files": [ - "library.js" + "library.mjs" ], + "type": "module", "private": true } |