Skip to content

Commit

Permalink
Switch to eslint (microsoft#1824)
Browse files Browse the repository at this point in the history
* swith to eslint
  • Loading branch information
chicm-ms authored Dec 5, 2019
1 parent 06b96d6 commit 4b6dfbe
Show file tree
Hide file tree
Showing 5 changed files with 2,171 additions and 73 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
displayName: 'Run pylint'
- script: |
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
python3 -m flake8 . --count --per-file-ignores=$IGNORE --select=E9,F63,F72,F82 --show-source --statistics
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 --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
- script: |
cd test
Expand Down
30 changes: 30 additions & 0 deletions src/nni_manager/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"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 changes: 5 additions & 1 deletion src/nni_manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "tsc",
"test": "nyc mocha -r ts-node/register -t 15000 --recursive **/*.test.ts --exclude node_modules/**/**/*.test.ts --colors",
"start": "node dist/main.js",
"tslint": "tslint -p ."
"eslint": "npx eslint ./ --ext .ts"
},
"license": "MIT",
"dependencies": {
Expand Down Expand Up @@ -42,9 +42,13 @@
"@types/ssh2": "^0.5.35",
"@types/stream-buffers": "^3.0.2",
"@types/tmp": "^0.0.33",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"chai": "^4.1.2",
"eslint": "^6.7.2",
"glob": "^7.1.3",
"mocha": "^5.2.0",
"npx": "^10.2.0",
"nyc": "^13.1.0",
"request": "^2.87.0",
"rmdir": "^1.2.0",
Expand Down
25 changes: 0 additions & 25 deletions src/nni_manager/tslint.json

This file was deleted.

Loading

0 comments on commit 4b6dfbe

Please sign in to comment.