Skip to content

Commit

Permalink
♻️ Use New eslint Flat Configuration File eslint.config.js (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
  • Loading branch information
pcaversaccio authored Feb 15, 2024
1 parent 772abf6 commit f03a803
Show file tree
Hide file tree
Showing 13 changed files with 546 additions and 564 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

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

This file was deleted.

41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const eslintConfigPrettier = require("eslint-config-prettier");
/* eslint-enable @typescript-eslint/no-var-requires */

module.exports = tseslint.config(
{
files: ["**/*.{js,ts}"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
eslintConfigPrettier,
],
plugins: {
"@typescript-eslint": tseslint.plugin,
},
languageOptions: {
ecmaVersion: "latest",
parser: tseslint.parser,
parserOptions: {
project: true,
},
},
},
{
ignores: [
"node_modules/**",
"interface/**",
"lib/**",
"cache/**",
"typechain-types/**",
"artifacts/**",
"forge-artifacts/**",
"coverage/**",
"bin/**",
"out/**",
],
},
);
4 changes: 0 additions & 4 deletions interface/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions interface/.eslintrc.json

This file was deleted.

41 changes: 41 additions & 0 deletions interface/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const next = require("@next/eslint-plugin-next");
const react = require("eslint-plugin-react");
const reactHooks = require("eslint-plugin-react-hooks");
const eslintConfigPrettier = require("eslint-config-prettier");
/* eslint-enable @typescript-eslint/no-var-requires */

module.exports = tseslint.config(
{
files: ["**/*.{js,ts,tsx}"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
eslintConfigPrettier,
],
plugins: {
"@typescript-eslint": tseslint.plugin,
"@next/next": next,
react: react,
"react-hooks": reactHooks,
},
rules: {
...next.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
},
languageOptions: {
ecmaVersion: "latest",
parser: tseslint.parser,
parserOptions: {
project: true,
},
},
},
{
ignores: ["node_modules/**", ".next/**", "next-env.d.ts", "dist/**"],
},
);
13 changes: 9 additions & 4 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"start": "pnpm build && npx next start",
"prettier:check": "npx prettier -c \"**/*.{js,ts,tsx,css,md,json,yml,yaml}\"",
"prettier:fix": "npx prettier -w \"**/*.{js,ts,tsx,css,md,json,yml,yaml}\"",
"lint:check": "pnpm prettier:check && npx next lint",
"lint:fix": "pnpm prettier:fix && npx next lint --fix"
"lint:check": "pnpm prettier:check && npx eslint .",
"lint:fix": "pnpm prettier:fix && npx eslint . --fix"
},
"dependencies": {
"@headlessui/react": "^1.7.18",
Expand All @@ -40,18 +40,23 @@
"sharp": "^0.33.2"
},
"devDependencies": {
"@eslint/js": "^8.56.0",
"@next/eslint-plugin-next": "^14.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.11.17",
"@types/node": "^20.11.18",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.17",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"next-seo": "^6.4.0",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"typescript-eslint": "^7.0.1"
}
}
3 changes: 2 additions & 1 deletion interface/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["**/*.js", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"files": ["next-env.d.ts", "eslint.config.js"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion lib/forge-std
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,24 @@
"prettier:fix:interface": "cd interface && pnpm prettier:fix",
"solhint:check": "npx solhint -c src/.solhint.json \"src/**/*.sol\" && npx solhint -c test/.solhint-tests.json \"test/**/*.sol\"",
"solhint:fix": "npx solhint -c src/.solhint.json \"src/**/*.sol\" --fix && npx solhint -c test/.solhint-tests.json \"test/**/*.sol\" --fix",
"lint:check": "pnpm prettier:check && pnpm solhint:check && npx eslint \"**/*.{js,ts}\"",
"lint:check": "pnpm prettier:check && pnpm solhint:check && npx eslint .",
"lint:check:interface": "cd interface && pnpm lint:check",
"lint:fix": "pnpm prettier:fix && pnpm solhint:fix && npx eslint \"**/*.{js,ts}\" --fix",
"lint:fix": "pnpm prettier:fix && pnpm solhint:fix && npx eslint . --fix",
"lint:fix:interface": "cd interface && pnpm lint:fix",
"dev:interface": "cd interface && pnpm dev",
"build:interface": "cd interface && pnpm build",
"start:interface": "cd interface && pnpm start"
},
"devDependencies": {
"@eslint/js": "^8.56.0",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-verify": "^2.0.4",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"ethers": "^6.11.0",
"hardhat": "^2.19.5",
"ethers": "^6.11.1",
"hardhat": "^2.20.0",
"hardhat-abi-exporter": "^2.10.1",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.10",
Expand Down
Loading

0 comments on commit f03a803

Please sign in to comment.