-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable all tslint and eslint rules in generated code (#328)
* Disable all tslint rules in generated code so as to play well with all tslint configurations. * Add tslint config * git-ignore renamed files * Disable all eslint rules in generated TypeScript code like we do for tslint * Use a more recent version of Node.js to avoid error "Module.createRequire is not a function" when running eslint. * Fix package conflict * Maybe we don't need the 'js' command. Try testing for just 'node'. * Check for npm * Use 'node' instead of 'js' in atdts tests
- Loading branch information
Showing
11 changed files
with
113 additions
and
49 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
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
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,22 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
/package-lock.json | ||
|
||
# Test output | ||
/a_str | ||
/b_str | ||
/b_str2 | ||
/aStr | ||
/bStr | ||
/bStr2 |
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,15 +1,21 @@ | ||
JS ?= js | ||
JS ?= node | ||
|
||
.PHONY: test | ||
test: | ||
# Install TypeScript and JavaScript dependencies locally | ||
npm install | ||
$(MAKE) lint | ||
# Compile TypeScript (handwritten + generated by atdts) to JavaScript | ||
npm run tsc | ||
# Run the resulting code (compiled from TypeScript) | ||
$(JS) manual_sample.js | ||
$(JS) test_atdts.js | ||
|
||
# Check for warnings from tslint and eslint, especially in the generated code | ||
.PHONY: lint | ||
lint: | ||
npm run lint | ||
|
||
.PHONY: clean | ||
clean: | ||
git clean -dfX |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
{ | ||
"scripts": { | ||
"tsc": "tsc" | ||
"tsc": "tsc", | ||
"lint": "tslint --project tsconfig.json && eslint *.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^17.0.25", | ||
"npx": "^10.2.2", | ||
"@typescript-eslint/eslint-plugin": "^5.49.0", | ||
"@typescript-eslint/parser": "^5.49.0", | ||
"eslint": "^8.32.0", | ||
"typescript": "^4.6.3" | ||
}, | ||
"dependencies": { | ||
"tslint": "^6.1.3" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "tslint:recommended" | ||
} |