Skip to content

Commit

Permalink
Set up format and lint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jan 22, 2020
1 parent 35f0a0a commit 00926c7
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_size = 4
61 changes: 61 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"env": {
"es6": true,
"jasmine": true,
"node": true,
"worker": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018
},
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:import/typescript"
],
"rules": {
"curly": ["warn", "multi-line", "consistent"],
"no-console": ["warn", { "allow": ["error", "info", "warn"] }],
"no-param-reassign": "warn",
"no-shadow": "warn",
"prefer-const": "warn",
"spaced-comment": ["warn", "always", { "line": { "markers": ["/ <reference"] } }],
"import/no-cycle": "warn",
"simple-import-sort/sort": "warn",
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-use-before-define": "warn"
},
"overrides": [
{
"files": "**/*.js",
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": "**/*.spec.ts",
"rules": {
"@typescript-eslint/no-non-null-assertion": "off"
}
},
{
"files": "jasmine-testrunner.js",
"rules": {
"@typescript-eslint/camelcase": ["error", { "properties": "never" }]
}
},
{
"files": "packages/{iov-bns,iov-tendermint-rpc}/**/*.ts",
"rules": {
"@typescript-eslint/camelcase": ["error", { "allow": ["v0_[0-9]+"] }]
}
}
]
}
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 110,
"trailingComma": "all"
}

0 comments on commit 00926c7

Please sign in to comment.