Skip to content

Commit

Permalink
chore: Replace tslint with eslint (#2555)
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrinizzard committed Apr 30, 2024
1 parent bc0608f commit e50d5a0
Show file tree
Hide file tree
Showing 17 changed files with 14,144 additions and 5,286 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist
node_modules
packages/*/dist
packages/*/node_modules
test/runs
test/input

license
104 changes: 104 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"overrides": [
{
"extends": ["canonical/json"],
"files": "*.json"
},
{
"extends": [
"eslint:recommended",
"canonical/typescript",
"canonical/typescript-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"plugins": ["canonical"],
"parserOptions": {
"tsconfigRootDir": "./",
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"]
},
"settings": {
"import/resolver": {
"typescript": true,
"node": true
}
},
"rules": {
"comma-dangle": "off",
"no-extra-parens": "off",
"no-case-declarations": "warn",
"no-duplicate-imports": "error",
"canonical/prefer-inline-type-import": "error",
"typescript-sort-keys/string-enum": "off",

"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
"import/first": "error",
"import/order": [
"error",
{
"newlines-between": "always",
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
"pathGroups": [
{
"pattern": "@/**",
"group": "internal",
"position": "before"
}
],
"alphabetize": {
"order": "asc" /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
"caseInsensitive": true /* ignore case. Options: [true, false] */
}
}
],

"import/no-absolute-path": "error",
"import/no-cycle": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": "error",
"import/no-named-as-default": "off",
"import/no-useless-path-segments": "error",

"@typescript-eslint/class-literal-property-style": "off",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/indent": "off",
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true }],
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-loop-func": "warn",
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
"@typescript-eslint/no-unused-vars": ["error", { "vars": "local", "args": "none" }],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/require-array-sort-compare": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/unified-signatures": "error"
},
"overrides": [
{
"files": "*.d.ts",
"rules": {
"no-var": "off"
}
}
],
"files": "*.ts"
}
],
"root": true
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ test/fixtures/objective-c/quicktype
/.bsp
.metals
.scala-build
.vscode
76 changes: 38 additions & 38 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "quicktype",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"runtimeArgs": ["--nolazy"],
"args": [
"--project",
"src/cli/tsconfig.json",
"src/cli/index.ts",
"--lang",
"dart",
"--src-lang",
"json",
"./test/inputs/json/priority/blns-object.json"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector"
},
{
"name": "test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"args": ["--project", "test/tsconfig.json", "test/test.ts"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"env": {
"CPUs": "1",
"FIXTURE": "golang"
}
}
]
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "quicktype",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"runtimeArgs": ["--nolazy"],
"args": [
"--project",
"src/cli/tsconfig.json",
"src/cli/index.ts",
"--lang",
"dart",
"--src-lang",
"json",
"./test/inputs/json/priority/blns-object.json"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector"
},
{
"name": "test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"args": ["--project", "test/tsconfig.json", "test/test.ts"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"env": {
"CPUs": "1",
"FIXTURE": "golang"
}
}
]
}
62 changes: 38 additions & 24 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
{
// Place your settings in this file to overwrite default and user settings.
"editor.formatOnSave": true,
"spellright.ignoreFiles": [
"**/.gitignore",
"**/.spellignore"
],
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true,
"output": true,
"**/obj": true,
"**/bin": true,
"test/inputs": true,
"test/runs": true,
"app/build": true,
"elm-stuff": true,
"dist": true
},
"explorer.excludeGitIgnore": false,
"spellright.documentTypes": [],
"java.configuration.updateBuildConfiguration": "automatic"
}
// Place your settings in this file to overwrite default and user settings.
"editor.formatOnSave": true,
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true,
"output": true,
"**/obj": true,
"**/bin": true,
"test/inputs": true,
"test/runs": true,
"app/build": true,
"elm-stuff": true,
"dist": true
},
"explorer.excludeGitIgnore": false,
"java.configuration.updateBuildConfiguration": "automatic",

"files.associations": {
"*.schema": "jsonc"
},

"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.wordWrap": "on",
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.detectIndentation": false
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.wordWrap": "on",
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.detectIndentation": false
}
}
15 changes: 0 additions & 15 deletions .vscode/tasks.json

This file was deleted.

0 comments on commit e50d5a0

Please sign in to comment.