Unverified Commit 4b6dfbe3 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Switch to eslint (#1824)

* swith to eslint
parent 06b96d60
...@@ -38,8 +38,8 @@ jobs: ...@@ -38,8 +38,8 @@ jobs:
displayName: 'Run pylint' displayName: 'Run pylint'
- script: | - script: |
python3 -m pip install flake8 --user python3 -m pip install flake8 --user
IGNORE=./tools/nni_annotation/testcase/*:F821,./examples/trials/mnist-nas/*/mnist*.py:F821,./examples/trials/nas_cifar10/src/cifar10/general_child.py:F821 EXCLUDES=./src/nni_manager/,./tools/nni_annotation/testcase/,./examples/trials/mnist-nas/*/mnist*.py,./examples/trials/nas_cifar10/src/cifar10/general_child.py
python3 -m flake8 . --count --per-file-ignores=$IGNORE --select=E9,F63,F72,F82 --show-source --statistics python3 -m flake8 . --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
displayName: 'Run flake8 tests to find Python syntax errors and undefined names' displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
- script: | - script: |
cd test cd test
......
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": 0
},
"ignorePatterns": [
"node_modules/",
"test/",
"dist/",
"types/",
"**/*.js"
]
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"build": "tsc", "build": "tsc",
"test": "nyc mocha -r ts-node/register -t 15000 --recursive **/*.test.ts --exclude node_modules/**/**/*.test.ts --colors", "test": "nyc mocha -r ts-node/register -t 15000 --recursive **/*.test.ts --exclude node_modules/**/**/*.test.ts --colors",
"start": "node dist/main.js", "start": "node dist/main.js",
"tslint": "tslint -p ." "eslint": "npx eslint ./ --ext .ts"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
...@@ -42,9 +42,13 @@ ...@@ -42,9 +42,13 @@
"@types/ssh2": "^0.5.35", "@types/ssh2": "^0.5.35",
"@types/stream-buffers": "^3.0.2", "@types/stream-buffers": "^3.0.2",
"@types/tmp": "^0.0.33", "@types/tmp": "^0.0.33",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"chai": "^4.1.2", "chai": "^4.1.2",
"eslint": "^6.7.2",
"glob": "^7.1.3", "glob": "^7.1.3",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"npx": "^10.2.0",
"nyc": "^13.1.0", "nyc": "^13.1.0",
"request": "^2.87.0", "request": "^2.87.0",
"rmdir": "^1.2.0", "rmdir": "^1.2.0",
......
{
"defaultSeverity": "error",
"extends": "tslint-microsoft-contrib",
"jsRules": {},
"rules": {
"no-relative-imports": false,
"export-name": false,
"interface-name": [true, "never-prefix"],
"no-increment-decrement": false,
"promise-function-async": false,
"no-console": [true, "log"],
"no-multiline-string": false,
"no-suspicious-comment": false,
"no-backbone-get-set-outside-model": false,
"max-classes-per-file": false
},
"rulesDirectory": [],
"linterOptions": {
"exclude": [
"training_service/test/*",
"rest_server/test/*",
"core/test/*"
]
}
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment