Skip to content

Commit

Permalink
feat: eslint for json
Browse files Browse the repository at this point in the history
eslint for linting json, more contraints
  • Loading branch information
martinwang2002 committed Feb 25, 2022
1 parent aaea89e commit 778b53f
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 38 deletions.
44 changes: 40 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@
"error",
"always"
],
"@typescript-eslint/prefer-readonly-parameter-types": [
"error",
{
"ignoreInferredTypes": true,
"treatMethodsAsReadonly": false
}
],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/unbound-method": "off", "no-extra-parens": "off",
"@typescript-eslint/unbound-method": "off",
"no-extra-parens": "off",
"no-use-before-define": "off",
"quotes": [
"error",
Expand Down Expand Up @@ -113,18 +121,40 @@
],
"parser": "jsonc-eslint-parser",
"rules": {
"jsonc/array-bracket-newline": [
"error",
{
"minItems": 0,
"multiline": true
}
],
"jsonc/array-element-newline": [
"error",
"always"
],
"jsonc/comma-dangle": "error",
"jsonc/indent": ["error",
"jsonc/indent": [
"error",
4,
{}
],
"jsonc/key-spacing": ["error",
"jsonc/key-spacing": [
"error",
{
"afterColon": true,
"beforeColon": false,
"mode": "strict"
}
],
"jsonc/object-curly-newline": [
"error",
{
"consistent": true,
"minProperties": 0,
"multiline": true
}
],
"jsonc/object-property-newline": "error",
"jsonc/sort-array-values": [
"error",
{
Expand All @@ -135,7 +165,13 @@
}
],
"jsonc/sort-keys": "error",
"no-multiple-empty-lines": ["error", { "max": 0, "maxEOF": 1 }]
"no-multiple-empty-lines": [
"error",
{
"max": 0,
"maxEOF": 1
}
]
}
}
],
Expand Down
68 changes: 34 additions & 34 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"compilerOptions": {
"target": "esnext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
"compilerOptions": {
"allowJs": false,
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"paths": {
"@/*": [
"src/*"
]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext"
},
"incremental": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}

0 comments on commit 778b53f

Please sign in to comment.