Skip to content

Commit

Permalink
Update @frosas/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
frosas committed Apr 11, 2024
1 parent f976fc6 commit 0406d77
Show file tree
Hide file tree
Showing 38 changed files with 3,008 additions and 1,147 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Should

- Remove NODE_OPTIONS=--openssl-legacy-provider once I stop using the current webpack version
- Remove globals package direct dependency once I stop using the current webpack version

## Could

Expand Down
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ module.exports = (api) => ({
targets: (() => {
switch (api.env()) {
case "browser":
return "defaults";
return "defaults"
case "node":
return { node: true };
return { node: true }
default:
throw new Error();
throw new Error()
}
})(),
},
Expand All @@ -26,4 +26,4 @@ module.exports = (api) => ({
"@babel/preset-typescript",
],
sourceType: "unambiguous",
});
})
44 changes: 44 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const frosasConfig = require("@frosas/eslint-config")
const globals = require("globals")
const tsEslint = require("typescript-eslint")
const reactConfigRecommended = require("eslint-plugin-react/configs/recommended")

const { config } = tsEslint

const reactConfig = config({
files: ["**/*.{jsx,tsx}"],
...reactConfigRecommended,
settings: {
...reactConfigRecommended.settings,
react: {
...reactConfigRecommended.settings?.react,
version: "detect",
},
},
})

const tsConfig = config(...tsEslint.configs.recommended, {
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
},
})

module.exports = config(
...frosasConfig,
...reactConfig,
...tsConfig,
{
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: { ecmaVersion: 2020 },
globals: {
...globals.es2020,
...globals.node,
},
},
},
{ ignores: ["!**/.*.js", "dist/"] },
)
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "@frosas/eslint-config"
declare module "eslint-plugin-react"
declare module "eslint-plugin-react/configs/recommended"
Loading

0 comments on commit 0406d77

Please sign in to comment.