Skip to content

Commit

Permalink
migrate the remaining eslint versions
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Dec 19, 2024
1 parent 010ed91 commit 2c6900b
Show file tree
Hide file tree
Showing 33 changed files with 190 additions and 154 deletions.
2 changes: 1 addition & 1 deletion clis/generator-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion clis/vercel-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:vitest/recommended",
// "plugin:vitest/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:tailwindcss/recommended",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/fdr-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"docs:dev": "pnpm dev",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/loadable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
9 changes: 7 additions & 2 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"name": "@fern-api/eslint-config",
"version": "0.0.0",
"private": true,
"main": "src/index.js",
"type": "module",
"main": "src/index.mjs",
"dependencies": {
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@next/eslint-plugin-next": "14.2.9",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
Expand All @@ -14,7 +18,8 @@
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-vitest": "^0.5.4"
"eslint-plugin-vitest": "^0.5.4",
"globals": "^15.14.0"
},
"devDependencies": {
"prettier": "^3.4.2"
Expand Down
122 changes: 0 additions & 122 deletions packages/eslint/src/index.js

This file was deleted.

131 changes: 131 additions & 0 deletions packages/eslint/src/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import deprecation from "eslint-plugin-deprecation";
import _import from "eslint-plugin-import";
import tailwindcss from "eslint-plugin-tailwindcss";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/*.js", "**/*.jsx"],
}, ...fixupConfigRules(compat.extends(
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:tailwindcss/recommended",
"plugin:@next/next/recommended",
)), {
plugins: {
deprecation,
import: fixupPluginRules(_import),
tailwindcss: fixupPluginRules(tailwindcss),
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
ecmaVersion: 12,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},

project: ["./tsconfig.eslint.json", "./packages/**/tsconfig.json"],
allowAutomaticSingleRunInference: true,
tsconfigRootDir: "/Volumes/git/fern-platform/packages/eslint/src",
},
},

settings: {
react: {
version: "^18.2.0",
},

settings: {
next: {
rootDir: "packages/docs-bundle/",
},
},
},

rules: {
"@typescript-eslint/no-unused-vars": ["error", {
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
}],

"@typescript-eslint/no-namespace": ["error", {
allowDeclarations: true,
}],

"@typescript-eslint/explicit-module-boundary-types": ["error", {
allowHigherOrderFunctions: false,
}],

"@typescript-eslint/no-floating-promises": ["error"],

"@typescript-eslint/no-empty-function": ["error", {
allow: ["private-constructors", "protected-constructors", "decoratedFunctions"],
}],

"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"linebreak-style": ["error", "unix"],
"no-console": "error",

"no-empty": ["error", {
allowEmptyCatch: true,
}],

"no-unused-vars": "off",

quotes: ["error", "double", {
avoidEscape: true,
}],

semi: ["error", "always"],
indent: "off",
"object-shorthand": ["error"],
"deprecation/deprecation": "error",

"import/no-internal-modules": ["error", {
forbid: ["@fern-ui/*/**", "@fern-docs/*/**"],
}],

eqeqeq: ["error", "always", {
null: "never",
}],

curly: "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"tailwindcss/no-custom-classname": "off",
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
},
}];
2 changes: 1 addition & 1 deletion packages/fern-docs/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"docs:dev": "pnpm dev",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/fern-docs/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint": "pnpm lint:eslint && pnpm lint:style",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/fern-docs/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"docs:dev": "pnpm dev",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/fern-docs/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"depcheck": "depcheck",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/fern-docs/edge-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"docs:dev": "pnpm dev",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint": "eslint --max-warnings 0 .",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
"lint:style:fix": "pnpm lint:style --fix",
Expand Down
Loading

0 comments on commit 2c6900b

Please sign in to comment.