Skip to content

Commit

Permalink
Add eslint, standard, husky
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Dec 20, 2023
1 parent 653bcd0 commit 5406020
Show file tree
Hide file tree
Showing 6 changed files with 2,011 additions and 70 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:security/recommended-legacy',
'standard-with-typescript',
'next/core-web-vitals'
],
parserOptions: {
project: './tsconfig.json'
},
ignorePatterns: ['.eslintrc.js', 'next.config.js', 'next-env.d.ts'],
rules: {
'@typescript-eslint/key-spacing': 0,
'multiline-ternary': 0,
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
'max-len': [
2,
{
code: 100,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true
}
]
}
}
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run prepush
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["numso.prettier-standard-vscode"]
}
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"generate-supported-networks": "node .github/scripts/generateSupportedNetworks.js"
"generate-supported-networks": "node .github/scripts/generateSupportedNetworks.js",
"lint": "eslint .",
"typecheck": "tsc --noEmit --incremental false",
"prepush": "pnpm lint && pnpm typecheck"
},
"repository": {
"type": "git",
Expand All @@ -32,8 +35,24 @@
"shelljs": "^0.8.5"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.0.4",
"@typescript-eslint/parser": "^6.15.0",
"@types/node": "18.11.10",
"@types/react": "18.2.37",
"env-cmd": "^10.1.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-config-standard": "^17.1.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-security": "^2.1.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"husky": "^8.0.3",
"typescript": "^4.9.3"
}
}
Loading

0 comments on commit 5406020

Please sign in to comment.