-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from northword:eslint
Add ESlint and Prettier
- Loading branch information
Showing
12 changed files
with
133 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"overrides": [], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/ban-ts-comment": ["warn", "allow-with-description"], | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-explicit-any": ["off", { "ignoreRestArgs": true }], | ||
"@typescript-eslint/no-non-null-assertion": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"**/dist/**", | ||
"**/node_modules/**", | ||
"**/abbrevIso*", | ||
"**/example*", | ||
"**/*.bak", | ||
"coverage/**", | ||
"docs-shared/lib/**", | ||
"packages/*/assets/**", | ||
"packages/*/lib/**", | ||
"!.vuepress/**", | ||
"**/.vuepress/.cache/**", | ||
"**/.vuepress/.temp/**" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,22 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Restart", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": [ | ||
"run", | ||
"restart" | ||
], | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Restart in Prod Mode", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": [ | ||
"run", | ||
"restart-prod" | ||
], | ||
} | ||
] | ||
} | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Restart", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": ["run", "restart"] | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Restart in Prod Mode", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": ["run", "restart-prod"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.formatOnType": false, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
{ | ||
"appendElement - full": { | ||
"scope": "javascript,typescript", | ||
"prefix": "appendElement", | ||
"body": [ | ||
"appendElement({", | ||
"\ttag: '${1:div}',", | ||
"\tid: '${2:id}',", | ||
"\tnamespace: '${3:html}',", | ||
"\tclassList: ['${4:class}'],", | ||
"\tstyles: {${5:style}: '$6'},", | ||
"\tproperties: {},", | ||
"\tattributes: {},", | ||
"\t[{ '${7:onload}', (e: Event) => $8, ${9:false} }],", | ||
"\tcheckExistanceParent: ${10:HTMLElement},", | ||
"\tignoreIfExists: ${11:true},", | ||
"\tskipIfExists: ${12:true},", | ||
"\tremoveIfExists: ${13:true},", | ||
"\tcustomCheck: (doc: Document, options: ElementOptions) => ${14:true},", | ||
"\tchildren: [$15]", | ||
"}, ${16:container});" | ||
] | ||
}, | ||
"appendElement - minimum": { | ||
"scope": "javascript,typescript", | ||
"prefix": "appendElement", | ||
"body": "appendElement({ tag: '$1' }, $2);" | ||
}, | ||
"register Notifier": { | ||
"scope": "javascript,typescript", | ||
"prefix": "registerObserver", | ||
"body": [ | ||
"registerObserver({", | ||
"\t notify: (", | ||
"\t\tevent: _ZoteroTypes.Notifier.Event,", | ||
"\t\ttype: _ZoteroTypes.Notifier.Type,", | ||
"\t\tids: string[],", | ||
"\t\textraData: _ZoteroTypes.anyObj", | ||
"\t) => {", | ||
"\t\t$0", | ||
"\t}", | ||
"});" | ||
] | ||
} | ||
"appendElement - full": { | ||
"scope": "javascript,typescript", | ||
"prefix": "appendElement", | ||
"body": [ | ||
"appendElement({", | ||
"\ttag: '${1:div}',", | ||
"\tid: '${2:id}',", | ||
"\tnamespace: '${3:html}',", | ||
"\tclassList: ['${4:class}'],", | ||
"\tstyles: {${5:style}: '$6'},", | ||
"\tproperties: {},", | ||
"\tattributes: {},", | ||
"\t[{ '${7:onload}', (e: Event) => $8, ${9:false} }],", | ||
"\tcheckExistanceParent: ${10:HTMLElement},", | ||
"\tignoreIfExists: ${11:true},", | ||
"\tskipIfExists: ${12:true},", | ||
"\tremoveIfExists: ${13:true},", | ||
"\tcustomCheck: (doc: Document, options: ElementOptions) => ${14:true},", | ||
"\tchildren: [$15]", | ||
"}, ${16:container});" | ||
] | ||
}, | ||
"appendElement - minimum": { | ||
"scope": "javascript,typescript", | ||
"prefix": "appendElement", | ||
"body": "appendElement({ tag: '$1' }, $2);" | ||
}, | ||
"register Notifier": { | ||
"scope": "javascript,typescript", | ||
"prefix": "registerObserver", | ||
"body": [ | ||
"registerObserver({", | ||
"\t notify: (", | ||
"\t\tevent: _ZoteroTypes.Notifier.Event,", | ||
"\t\ttype: _ZoteroTypes.Notifier.Type,", | ||
"\t\tids: string[],", | ||
"\t\textraData: _ZoteroTypes.anyObj", | ||
"\t) => {", | ||
"\t\t$0", | ||
"\t}", | ||
"});" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.makeItRed { | ||
background-color: tomato; | ||
} | ||
background-color: tomato; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"6": "/path/to/zotero6.exe", | ||
"7": "/path/to/zotero7.exe" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters