Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-23113][runtime-web] Migrate from tslint to eslint and add styl…
…elint for less
- Loading branch information
子扬
committed
Aug 20, 2021
1 parent
f543e9a
commit af560fe
Showing
190 changed files
with
8,141 additions
and
23,500 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.eslintcache | ||
.cache | ||
scalastyle-output.xml | ||
.classpath | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
.idea | ||
gen | ||
web | ||
tsc-out | ||
dist | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
.cache/ | ||
|
||
# yarn v2 | ||
.yarn | ||
|
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,145 @@ | ||
module.exports = { | ||
root: true, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2021, | ||
sourceType: 'module', | ||
tsconfigRootDir: __dirname, | ||
project: ['tsconfig.json'], | ||
createDefaultProgram: true | ||
}, | ||
plugins: ['@typescript-eslint', 'jsdoc', 'import', 'unused-imports'], | ||
extends: [ | ||
'plugin:@angular-eslint/recommended', | ||
'plugin:@angular-eslint/template/process-inline-templates', | ||
'plugin:prettier/recommended' | ||
], | ||
rules: { | ||
'jsdoc/newline-after-description': 1, | ||
'@angular-eslint/no-host-metadata-property': 'off', | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ | ||
default: 'array-simple' | ||
} | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Object: { | ||
message: 'Use {} instead.' | ||
}, | ||
String: { | ||
message: 'Use string instead.' | ||
}, | ||
Number: { | ||
message: 'Use number instead.' | ||
}, | ||
Boolean: { | ||
message: 'Use boolean instead.' | ||
}, | ||
Function: { | ||
message: 'Use specific callable interface instead.' | ||
} | ||
} | ||
} | ||
], | ||
'@typescript-eslint/consistent-type-definitions': 'error', | ||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'off', | ||
{ | ||
accessibility: 'explicit' | ||
} | ||
], | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'@typescript-eslint/no-inferrable-types': [ | ||
'error', | ||
{ | ||
ignoreParameters: true, | ||
ignoreProperties: true | ||
} | ||
], | ||
'@typescript-eslint/no-this-alias': 'error', | ||
'@typescript-eslint/naming-convention': 'off', | ||
'@typescript-eslint/no-unused-expressions': 'off', | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'error', | ||
{ | ||
allowExpressions: true, | ||
allowConciseArrowFunctionExpressionsStartingWithVoid: true | ||
} | ||
], | ||
'prefer-arrow/prefer-arrow-functions': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'import/no-duplicates': 'error', | ||
'import/no-unused-modules': 'error', | ||
'import/no-unassigned-import': ['error', { allow: ['@angular/localize/init', 'zone.js', 'zone.js/**'] }], | ||
'import/order': [ | ||
'error', | ||
{ | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: false | ||
}, | ||
'newlines-between': 'always', | ||
groups: ['external', 'builtin', 'internal', ['parent', 'sibling', 'index']], | ||
pathGroups: [ | ||
{ | ||
pattern: '{@angular/**,rxjs,rxjs/operators}', | ||
group: 'external', | ||
position: 'before' | ||
}, | ||
{ | ||
pattern: '{services,interfaces,utils,config}', | ||
group: 'internal', | ||
position: 'before' | ||
} | ||
], | ||
pathGroupsExcludedImportTypes: [] | ||
} | ||
], | ||
'no-empty-function': 'off', | ||
'no-unused-expressions': 'error', | ||
'no-use-before-define': 'off', | ||
'no-bitwise': 'off', | ||
'no-duplicate-imports': 'error', | ||
'no-invalid-this': 'off', | ||
'no-irregular-whitespace': 'error', | ||
'no-magic-numbers': 'off', | ||
'no-multiple-empty-lines': 'error', | ||
'no-redeclare': 'off', | ||
'no-underscore-dangle': 'off', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'off', | ||
'prefer-object-spread': 'error', | ||
'prefer-template': 'error', | ||
yoda: 'error' | ||
} | ||
}, | ||
{ | ||
files: ['*.html'], | ||
extends: ['plugin:@angular-eslint/template/recommended'], | ||
rules: {} | ||
}, | ||
{ | ||
files: ['*.html'], | ||
excludedFiles: ['*inline-template-*.component.html'], | ||
extends: ['plugin:prettier/recommended'], | ||
rules: { | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
parser: 'angular' | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}; |
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,6 +1,4 @@ | ||
**/*.md | ||
**/*.svg | ||
**/*.html | ||
**/test.ts | ||
**/*.less | ||
package.json |
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,14 +1,26 @@ | ||
{ | ||
"singleQuote": true, | ||
"useTabs": false, | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"htmlWhitespaceSensitivity": "ignore", | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"proseWrap": "preserve", | ||
"trailingComma": "none", | ||
"overrides": [ | ||
{ | ||
"files": ".prettierrc", | ||
"options": { | ||
"parser": "json" | ||
} | ||
}, | ||
{ | ||
"files": "*.html", | ||
"options": { | ||
"printWidth": 100 | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.