Setup basic linter
This commit is contained in:
parent
897a0f8d8a
commit
60f1692906
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
||||
dist
|
||||
node_modules
|
||||
.eslintrc.js
|
136
.eslintrc.js
Normal file
136
.eslintrc.js
Normal file
@ -0,0 +1,136 @@
|
||||
module.exports = {
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
|
||||
sourceType: "module", // Allows for the use of imports
|
||||
project: "./tsconfig.json"
|
||||
},
|
||||
extends: ["plugin:@typescript-eslint/recommended"], // Uses the linting rules from @typescript-eslint/eslint-plugin
|
||||
env: {
|
||||
node: true, // Enable Node.js global variables
|
||||
},
|
||||
rules: {
|
||||
"array-callback-return": "error",
|
||||
"no-await-in-loop": "error",
|
||||
"no-cond-assign": [ "error", "always" ],
|
||||
"no-constant-binary-expression": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-constructor-return": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-promise-executor-return": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-undef": [ "error", { "typeof": true } ],
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unreachable-loop": "error",
|
||||
"no-unused-private-class-members": "error",
|
||||
"require-atomic-updates": "error",
|
||||
|
||||
"accessor-pairs": "error",
|
||||
"block-scoped-var": "error",
|
||||
"curly": [ "error", "all" ],
|
||||
"default-case": "error",
|
||||
"default-case-last": "error",
|
||||
"default-param-last": "error",
|
||||
"dot-notation": "error",
|
||||
"eqeqeq": "error",
|
||||
"func-style": [ "error", "expression" ],
|
||||
"grouped-accessor-pairs": [ "error", "getBeforeSet" ],
|
||||
"no-caller": "error",
|
||||
"no-console": "error",
|
||||
"no-eq-null": "error",
|
||||
"no-eval": "error",
|
||||
"no-extend-native": "error",
|
||||
"no-extra-label": "error",
|
||||
"no-implicit-coercion": "error",
|
||||
"no-implicit-globals": "error",
|
||||
"no-implied-eval": "error",
|
||||
"no-inline-comments": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "error",
|
||||
"no-labels": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-lonely-if": "error",
|
||||
"no-loop-func": "error",
|
||||
"no-magic-numbers": "error",
|
||||
"no-mixed-operators": "error",
|
||||
"no-multi-assign": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-nested-ternary": "error",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-nonoctal-decimal-escape": "error",
|
||||
"no-object-constructor": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-param-reassign": "error",
|
||||
"no-plusplus": "error",
|
||||
"no-proto": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-script-url": "error",
|
||||
"no-sequences": "error",
|
||||
"no-shadow": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-undefined": "error",
|
||||
"no-underscore-dangle": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-var": "error",
|
||||
"no-void": "error",
|
||||
"one-var": [ "error", "never" ],
|
||||
"one-var-declaration-per-line": [ "error", "always" ],
|
||||
"prefer-arrow-callback": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-exponentiation-operator": "error",
|
||||
"prefer-named-capture-group": "error",
|
||||
"prefer-numeric-literals": "error",
|
||||
"prefer-object-has-own": "error",
|
||||
"prefer-object-spread": "error",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"prefer-regex-literals": "error",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"prefer-template": "error",
|
||||
"quote-props": [ "error", "as-needed" ],
|
||||
"radix": "error",
|
||||
"require-await": "error",
|
||||
"require-unicode-regexp": "error",
|
||||
"symbol-description": "error",
|
||||
"yoda": "error",
|
||||
|
||||
"array-bracket-newline": [ "error", "consistent" ],
|
||||
"array-bracket-spacing": [ "error", "always", { "singleValue": false } ],
|
||||
"array-element-newline": [ "error", "consistent" ],
|
||||
"arrow-parens": "error",
|
||||
"arrow-spacing": "error",
|
||||
"block-spacing": "error",
|
||||
"computed-property-spacing": "error",
|
||||
"eol-last": "error",
|
||||
"generator-star-spacing": [ "error", { "before": false, "after": true } ],
|
||||
"key-spacing": "error",
|
||||
"linebreak-style": "error",
|
||||
"lines-around-comment": [ "error", { "allowBlockStart": true }],
|
||||
"max-len": [ "error", { "code": 120 } ],
|
||||
"new-parens": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-whitespace-before-property": "error",
|
||||
"nonblock-statement-body-position": [ "error", "below" ],
|
||||
"object-curly-newline": [ "error", { "ObjectExpression": { "consistent": true }, "ObjectPattern": { "consistent": true } } ],
|
||||
"operator-linebreak": "error",
|
||||
"padded-blocks": [ "error", "never" ],
|
||||
"space-in-parens": "error",
|
||||
"switch-colon-spacing": [ "error", { "after": false, "before": false } ],
|
||||
"template-curly-spacing": "error",
|
||||
"wrap-iife": "error",
|
||||
"yield-star-spacing": [ "error", "after" ],
|
||||
}
|
||||
};
|
1541
package-lock.json
generated
1541
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,12 +4,16 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"lint": "eslint . --fix"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@tsconfig/node-lts": "^18.12.5",
|
||||
"@types/node": "^20.8.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.7.4",
|
||||
"eslint": "^8.50.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
1
src/index.ts
Normal file
1
src/index.ts
Normal file
@ -0,0 +1 @@
|
||||
console.log("Hello, World!");
|
Loading…
x
Reference in New Issue
Block a user