setup prettier, eslint, husky
This commit is contained in:
parent
7810f6aa51
commit
ff307e0222
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"airbnb",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"@typescript-eslint/indent": ["error", 2],
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
cd ts
|
||||
yarn lint-staged
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "all"
|
||||
}
|
|
@ -12,13 +12,33 @@
|
|||
],
|
||||
"scripts": {
|
||||
"build": "rm -rf dist/; tsc",
|
||||
"test": "jest"
|
||||
"test": "jest",
|
||||
"prepare": "cd .. && husky install ts/.husky"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.ts": [
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
||||
"@typescript-eslint/parser": "^5.17.0",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"husky": "^7.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"lint-staged": "^12.3.7",
|
||||
"prettier": "^2.6.1",
|
||||
"ts-jest": "^27.1.4",
|
||||
"ts-jest-resolver": "^2.0.0",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@solana/web3.js": "^1.37.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import { PublicKey } from "@solana/web3.js";
|
||||
|
||||
export class Dex {
|
||||
public address: PublicKey;
|
||||
|
||||
constructor(address: PublicKey) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public hello_world(x: number): string {
|
||||
var c = x + 10;
|
||||
return `hello ${c}`;
|
||||
}
|
||||
}
|
1648
ts/yarn.lock
1648
ts/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue