Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switch from tslint to eslint #3651

Merged
merged 27 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f773ba1
chore(core): switch from tslint to eslint
Walther Feb 1, 2023
cb274e9
chore(cli): switch from tslint to eslint
Walther Feb 1, 2023
4038fe5
chore(e2e): switch from tslint to eslint
Walther Feb 1, 2023
a8f651c
chore(plugins/conftest): switch from tslint to eslint
Walther Feb 1, 2023
13f0d01
chore(plugins/conftest-container): switch from tslint to eslint
Walther Feb 1, 2023
4b3cd64
chore(plugins/conftest-kubernetes): switch from tslint to eslint
Walther Feb 1, 2023
da8c40b
chore(plugins/jib): switch from tslint to eslint
Walther Feb 1, 2023
76a3f01
chore(plugins/pulumi): switch from tslint to eslint
Walther Feb 1, 2023
59c5d1b
chore(plugins/terraform): switch from tslint to eslint
Walther Feb 1, 2023
ea51c12
chore(sdk): switch from tslint to eslint
Walther Feb 1, 2023
348e7c6
chore: completely eradicate tslint, initial switch to eslint done
Walther Feb 1, 2023
b8bda24
chore: remove all tslint.json configs
Walther Feb 1, 2023
8fd995b
Merge branch '0.13' into tslint-to-eslint
Walther Feb 1, 2023
39bb8d1
chore(core): fix eslint ignore pattern
Walther Feb 1, 2023
c389dff
chore: combine all .eslintrc.js files
Walther Feb 1, 2023
82dcf85
chore: more permissive lint rules, for max compatibility with old code
Walther Feb 2, 2023
83a2290
chore: change minimization between this branch and 0.13
Walther Feb 2, 2023
e8faa5f
chore: remove last tslint mention
Walther Feb 2, 2023
2ff46dc
chore: restore plugins/conftest-kubernetes/index.ts
Walther Feb 2, 2023
8f1d4b9
chore: restore plugins/jib
Walther Feb 2, 2023
e42b765
chore: restore plugins/pulumi
Walther Feb 2, 2023
898d6e3
chore: restore plugins/terraform
Walther Feb 2, 2023
9d483ca
chore: restore plugins/conftest-container
Walther Feb 2, 2023
06c4cfb
Merge branch '0.13' into tslint-to-eslint
Walther Feb 2, 2023
c2b4e1b
chore: separate generated .eslintrc and our overrides
Walther Feb 2, 2023
f8a1df9
Merge remote-tracking branch 'origin/tslint-to-eslint' into tslint-to…
Walther Feb 2, 2023
6c6decf
chore: .eslintrc extends the generated one
Walther Feb 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": [".eslintrc.autogenerated.js"],
"rules": {
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-shadow": [
"warn",
{
"hoist": "all"
}
],
"@typescript-eslint/quotes": [
"error",
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"arrow-body-style": "off",
"jsdoc/check-indentation": "off",
"jsdoc/newline-after-description": "off",
"max-len": [
"warn",
{
"code": 120,
"ignoreStrings": true,
"ignoreComments": true,
"ignoreTemplateLiterals": true
}
]
}
}
302 changes: 302 additions & 0 deletions .eslintrc.autogenerated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config

It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.

We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md

Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"eslint-plugin-react",
"eslint-plugin-jsdoc",
"eslint-plugin-no-null",
"@typescript-eslint",
],
"root": true,
"rules": {
"@babel/object-curly-spacing": "off",
"@babel/semi": "off",
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/comma-spacing": "off",
"@typescript-eslint/func-call-spacing": "off",
"@typescript-eslint/indent": [
"off",
2
],
"@typescript-eslint/keyword-spacing": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "forbid"
}
],
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/object-curly-spacing": "off",
"@typescript-eslint/quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/space-before-blocks": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/space-infix-ops": "off",
"@typescript-eslint/type-annotation-spacing": "off",
"array-bracket-newline": "off",
"array-bracket-spacing": "off",
"array-element-newline": "off",
"arrow-body-style": "error",
"arrow-parens": [
"off",
"always"
],
"arrow-spacing": "off",
"babel/object-curly-spacing": "off",
"babel/quotes": "off",
"babel/semi": "off",
"block-spacing": "off",
"brace-style": [
"off",
"off"
],
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
"computed-property-spacing": "off",
"curly": "error",
"dot-location": "off",
"eol-last": "error",
"eqeqeq": [
"error",
"always"
],
"flowtype/boolean-style": "off",
"flowtype/delimiter-dangle": "off",
"flowtype/generic-spacing": "off",
"flowtype/object-type-curly-spacing": "off",
"flowtype/object-type-delimiter": "off",
"flowtype/quotes": "off",
"flowtype/semi": "off",
"flowtype/space-after-type-colon": "off",
"flowtype/space-before-generic-bracket": "off",
"flowtype/space-before-type-colon": "off",
"flowtype/union-intersection-spacing": "off",
"func-call-spacing": "off",
"function-call-argument-newline": "off",
"function-paren-newline": "off",
"generator-star": "off",
"generator-star-spacing": "off",
"id-denylist": "error",
"id-match": "error",
"implicit-arrow-linebreak": "off",
"indent": "off",
"indent-legacy": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"jsx-quotes": "off",
"key-spacing": "off",
"keyword-spacing": "off",
"linebreak-style": "off",
"lines-around-comment": "off",
"max-len": [
"warn",
{
"code": 120
}
],
"multiline-ternary": "off",
"new-parens": "off",
"newline-per-chained-call": "off",
"no-arrow-condition": "off",
"no-comma-dangle": "off",
"no-confusing-arrow": "off",
"no-console": [
"error",
{
"allow": [
"warn",
"dir",
"time",
"timeEnd",
"timeLog",
"trace",
"assert",
"clear",
"count",
"countReset",
"group",
"groupEnd",
"table",
"debug",
"info",
"dirxml",
"groupCollapsed",
"Console",
"profile",
"profileEnd",
"timeStamp",
"context"
]
}
],
"no-debugger": "error",
"no-eval": "error",
"no-extra-parens": "off",
"no-extra-semi": "off",
"no-fallthrough": "error",
"no-floating-decimal": "off",
"no-invalid-this": "error",
"no-irregular-whitespace": "off",
"no-mixed-operators": "off",
"no-mixed-spaces-and-tabs": "off",
"no-multi-spaces": "off",
"no-multiple-empty-lines": "error",
"no-null/no-null": "off",
"no-reserved-keys": "off",
"no-shadow": "off",
"no-space-before-semi": "off",
"no-spaced-func": "off",
"no-tabs": "off",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
"no-unexpected-multiline": "off",
"no-var": "error",
"no-whitespace-before-property": "off",
"no-wrap-func": "off",
"nonblock-statement-body-position": "off",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": "off",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"one-var-declaration-per-line": "off",
"operator-linebreak": "off",
"padded-blocks": [
"off",
{
"blocks": "never"
},
{
"allowSingleLineBlocks": true
}
],
"prefer-template": "off",
"quote-props": [
"error",
"consistent-as-needed"
],
"quotes": "off",
"radix": "error",
"react/jsx-child-element-spacing": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-closing-tag-location": "off",
"react/jsx-curly-newline": "off",
"react/jsx-curly-spacing": "off",
"react/jsx-equals-spacing": "off",
"react/jsx-first-prop-new-line": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/jsx-max-props-per-line": "off",
"react/jsx-newline": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-multi-spaces": "off",
"react/jsx-space-before-closing": "off",
"react/jsx-tag-spacing": [
"off",
{
"afterOpening": "allow",
"closingSlash": "allow"
}
],
"react/jsx-wrap-multilines": "off",
"rest-spread-spacing": "off",
"semi": "off",
"semi-spacing": "off",
"semi-style": "off",
"space-after-function-name": "off",
"space-after-keywords": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-before-function-parentheses": "off",
"space-before-keywords": "off",
"space-in-brackets": "off",
"space-in-parens": [
"off",
"never"
],
"space-infix-ops": "off",
"space-return-throw-case": "off",
"space-unary-ops": "off",
"space-unary-word-ops": "off",
"standard/array-bracket-even-spacing": "off",
"standard/computed-property-even-spacing": "off",
"standard/object-curly-even-spacing": "off",
"switch-colon-spacing": "off",
"template-curly-spacing": "off",
"template-tag-spacing": "off",
"unicode-bom": "off",
"unicorn/empty-brace-spaces": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/number-literal-case": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "off"
}
};
6 changes: 3 additions & 3 deletions cli/bin/garden
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (process.env.GARDEN_ENABLE_PROFILING === "1" || process.env.GARDEN_ENABLE_PRO
Mod.prototype.require = function () {
const start = performance.now()

// tslint:disable-next-line: no-invalid-this
// eslint-disable-next-line no-invalid-this
const mod = req.apply(this, arguments)
profiler.log("require", start) // Aggregate of all requires

Expand All @@ -26,7 +26,7 @@ if (process.env.GARDEN_ENABLE_PROFILING === "1" || process.env.GARDEN_ENABLE_PRO
profiler.log(prefix + split[split.length - 1], start)
} else {
profiler.log(prefix + moduleName, start)
// tslint:disable-next-line: no-invalid-this
// eslint-disable-next-line no-invalid-this
profiler.log(prefix + basename(this.filename) + ":" + moduleName, start)
}

Expand All @@ -37,5 +37,5 @@ if (process.env.GARDEN_ENABLE_PROFILING === "1" || process.env.GARDEN_ENABLE_PRO
require("source-map-support").install()
const cli = require("../build/src/cli")

// tslint:disable-next-line: no-floating-promises
// eslint-disable-next-line @typescript-eslint/no-floating-promises
cli.runCli()
7 changes: 1 addition & 6 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.1.0",
"split2": "^3.2.2",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^6.2.0",
"tslint-no-unused": "^0.2.0-alpha.1",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^4.7.4",
"username": "^5.1.0"
},
Expand All @@ -60,7 +55,7 @@
"clean": "shx rm -rf build dist",
"fix-format": "prettier --write \"{src,test}/**/*.ts\"",
"generate-docs": "node ./build/src/generate-docs.js",
"lint": "tslint -p .",
"lint": "eslint -c ../.eslintrc --ext .ts src/",
"postinstall": "patch-package",
"test": "mocha"
},
Expand Down
4 changes: 2 additions & 2 deletions cli/src/add-version-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ async function addVersionFiles() {
const vcsHandler = new GitHandler(STATIC_DIR, garden.gardenDirPath, garden.dotIgnoreFile, new TreeCache())
const treeVersion = await vcsHandler.getTreeVersion(garden.log, garden.projectName, config)

// tslint:disable-next-line: no-console
// eslint-disable-next-line no-console
console.log(`${config.name} -> ${relative(STATIC_DIR, versionFilePath)}`)

return writeTreeVersionFile(path, treeVersion)
})
}

addVersionFiles().catch((err) => {
// tslint:disable-next-line: no-console
// eslint-disable-next-line no-console
console.error(err)
process.exit(1)
})
Loading