Add eslint and prettier configuration

This commit is contained in:
Zach Raines
2020-12-18 11:33:41 -05:00
parent 7ae75138d6
commit b1098d6732
4 changed files with 49 additions and 2 deletions

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
/**/*.js

21
.eslintrc.json Normal file
View File

@@ -0,0 +1,21 @@
{
"env": {
"browser": false,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
"prettier",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["prettier", "@typescript-eslint"]
}

12
.prettierrc Normal file
View File

@@ -0,0 +1,12 @@
{
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript"
}
}
]
}

View File

@@ -5,7 +5,8 @@
"main": "main.js",
"scripts": {
"dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js"
"build": "rollup --config rollup.config.js",
"lint": "eslint . --ext .ts,.tsx"
},
"keywords": [],
"author": "Jon Gauthier",
@@ -15,12 +16,24 @@
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-typescript": "^6.0.0",
"@types/node": "^14.14.2",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"codemirror": "^5.58.3",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.3.0",
"husky": "^4.3.6",
"obsidian": "https://github.com/obsidianmd/obsidian-api/tarball/master",
"prettier": "^2.2.1",
"rollup": "^2.32.1",
"tslib": "^2.0.3",
"typescript": "^4.0.3"
"typescript": "^4.1.3"
},
"dependencies": {
"open": "^7.3.0"
},
"lint-staged": {
"*.ts": "eslint --fix",
"*.json": "prettier --write"
}
}