Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-tslint

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-tslint - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

latest.js

13

package.json
{
"name": "eslint-config-tslint",
"version": "0.0.2",
"version": "0.0.3",
"description": "ESLint config which imitate TSLint",

@@ -9,2 +9,8 @@ "main": "index.js",

},
"peerDependencies": {
"eslint": ">=5.13.0",
"@typescript-eslint/eslint-plugin": ">=1.3.0",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-prefer-arrow": ">=1.1.4"
},
"repository": {

@@ -14,2 +20,7 @@ "type": "git",

},
"keywords": [
"eslint",
"eslintconfig",
"tslint"
],
"author": "Kanitkorn Sujautra <k.sujautra@gmail.com>",

@@ -16,0 +27,0 @@ "license": "MIT",

464

recommended.js
// Based on https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts
module.exports = {
plugins: [
'@typescript-eslint',
'import',
],
parser: '@typescript-eslint/parser',
plugins: ["@typescript-eslint", "import", "prefer-arrow"],
parser: "@typescript-eslint/parser",
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
// 'align': 'error', // Doesn't has any ESLint equivalent rule
'@typescript-eslint/array-type': ['error', 'array-simple'],
'arrow-parens': 'error',
'arrow-body-style': 'error',
'@typescript-eslint/ban-types': [
'error',
// "adjacent-overload-signatures": true,
"@typescript-eslint/adjacent-overload-signatures": "error",
// align: {
// options: ["parameters", "statements"]
// },
// Doesn't has any ESLint equivalent rule.
// "array-type": {
// options: ["array-simple"]
// },
"@typescript-eslint/array-type": ["error", "array-simple"],
// "arrow-parens": true,
"arrow-parens": "error",
// "arrow-return-shorthand": true,
"arrow-body-style": "error",
// "ban-types": {
// options: [
// ["Object", "Avoid using the `Object` type. Did you mean `object`?"],
// [
// "Function",
// "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
// ],
// ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"],
// ["Number", "Avoid using the `Number` type. Did you mean `number`?"],
// ["String", "Avoid using the `String` type. Did you mean `string`?"],
// ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"]
// ]
// },
"@typescript-eslint/ban-types": [
"error",
{
types: {
Object: 'Avoid using the `Object` type. Did you mean `object`?',
Object: "Avoid using the `Object` type. Did you mean `object`?",
Function:
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
Boolean: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
Number: 'Avoid using the `Number` type. Did you mean `number`?',
String: 'Avoid using the `String` type. Did you mean `string`?',
Symbol: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
},
},
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
Boolean: "Avoid using the `Boolean` type. Did you mean `boolean`?",
Number: "Avoid using the `Number` type. Did you mean `number`?",
String: "Avoid using the `String` type. Did you mean `string`?",
Symbol: "Avoid using the `Symbol` type. Did you mean `symbol`?"
}
}
],
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/class-name-casing': 'error',
'capitalized-comments': 'error',
'spaced-comment': 'error',
curly: 'error',
complexity: 'off',
'eol-last': 'error',
'guard-for-in': 'error',
// 'import-spacing': 'error', // Doesn't has any ESLint equivalent rule
indent: 'off',
'@typescript-eslint/indent': 'error',
'@typescript-eslint/interface-name-prefix': ['error', 'always'],
'@typescript-eslint/prefer-interface': 'error',
'valid-jsdoc': 'error', // TODO: Use eslint-plugin-jsdoc instead
'no-unused-labels': 'error',
'max-classes-per-file': ['error', 1],
'max-len': ['error', { code: 120 }],
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/member-ordering': 'error', // TODO: Make sure this has statics-first behavior
'new-parens': 'error',
'@typescript-eslint/no-angle-bracket-type-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'no-caller': 'error',
'no-bitwise': 'error',
'no-cond-assign': 'error',
'no-multiple-empty-lines': 'error',
'no-console': 'error',
'no-new-wrappers': 'error',
'no-debugger': 'error',
'constructor-super': 'error',
'no-empty': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'no-eval': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'no-invalid-this': 'off',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-triple-slash-reference': 'error',
// 'no-reference-import': 'error', // Doesn't has any ESLint equivalent rule
'no-shadow': 'error',
'dot-notation': 'error',
'no-throw-literal': 'error',
'no-fallthrough': 'off',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-unsafe-finally': 'error',
'no-unused-expression': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'no-var': 'error',
'@typescript-eslint/no-var-requires': 'error',
'quote-props': ['error', 'consistent-as-needed'],
'object-shorthand': 'error',
'sort-keys': 'error',
// 'one-line': 'error', // Doesn't has any ESLint equivalent rule
'one-var': 'error',
'prefer-arrow/prefer-arrow-functions': 'error', // TODO: Probably not equivalent to TSLint's `only-arrow-functions`
'import/order': 'error', // TODO: Probably not equivalent to TSLint's `ordered-imports`
'prefer-const': 'error',
// 'prefer-for-of': 'error', // Doesn't has any ESLint equivalent rule
quotes: ['error', 'double', { avoidEscape: true }],
radix: 'error',
semi: ['error', 'always'],
'space-before-function-paren': [
'error',
// "callable-types": true,
"@typescript-eslint/prefer-function-type": "error",
// "class-name": true,
"@typescript-eslint/class-name-casing": "error",
// "comment-format": {
// options: ["check-space"]
// },
"capitalized-comments": "error",
"spaced-comment": "error",
// curly: true,
curly: "error",
// "cyclomatic-complexity": false,
complexity: "off",
// eofline: true,
"eol-last": "error",
// forin: true,
"guard-for-in": "error",
// "import-spacing": true,
// Doesn't has any ESLint equivalent rule
// indent: {
// options: ["spaces"]
// },
indent: "off",
"@typescript-eslint/indent": "error",
// "interface-name": {
// options: ["always-prefix"]
// },
"@typescript-eslint/interface-name-prefix": ["error", "always"],
// "interface-over-type-literal": true,
"@typescript-eslint/prefer-interface": "error",
// "jsdoc-format": true,
"valid-jsdoc": "error", // TODO: Use eslint-plugin-jsdoc instead.
// "label-position": true,
"no-unused-labels": "error",
// "max-classes-per-file": { options: 1 },
"max-classes-per-file": ["error", 1],
// "max-line-length": { options: 120 },
"max-len": ["error", { code: 120 }],
// "member-access": true,
"@typescript-eslint/explicit-member-accessibility": "error",
// "member-ordering": {
// options: {
// order: "statics-first"
// }
// },
"@typescript-eslint/member-ordering": "error", // TODO: Make sure this has statics-first behavior
// "new-parens": true,
"new-parens": "error",
// "no-angle-bracket-type-assertion": true,
"@typescript-eslint/no-angle-bracket-type-assertion": "error",
// "no-any": false,
"@typescript-eslint/no-explicit-any": "off",
// "no-arg": true,
"no-caller": "error",
// "no-bitwise": true,
"no-bitwise": "error",
// "no-conditional-assignment": true,
"no-cond-assign": "error",
// "no-consecutive-blank-lines": true,
"no-multiple-empty-lines": "error",
// "no-console": true,
"no-console": "error",
// "no-construct": true,
"no-new-wrappers": "error",
// "no-debugger": true,
"no-debugger": "error",
// "no-duplicate-super": true,
"constructor-super": "error",
// "no-empty": true,
"no-empty": "error",
// "no-empty-interface": true,
"@typescript-eslint/no-empty-interface": "error",
// "no-eval": true,
"no-eval": "error",
// "no-internal-module": true,
"@typescript-eslint/prefer-namespace-keyword": "error",
// "no-invalid-this": false,
"no-invalid-this": "off",
// "no-misused-new": true,
"@typescript-eslint/no-misused-new": "error",
// "no-namespace": true,
"@typescript-eslint/no-namespace": "error",
// "no-parameter-properties": false,
"@typescript-eslint/no-parameter-properties": "off",
// "no-reference": true,
"@typescript-eslint/no-triple-slash-reference": "error",
// "no-reference-import": true,
// Doesn't has any ESLint equivalent rule.
// "no-shadowed-variable": true,
"no-shadow": "error",
// "no-string-literal": true,
"dot-notation": "error",
// "no-string-throw": true,
"no-throw-literal": "error",
// "no-switch-case-fall-through": false,
"no-fallthrough": "off",
// "no-trailing-whitespace": true,
"no-trailing-spaces": "error",
// "no-unnecessary-initializer": true,
"no-undef-init": "error",
// "no-unsafe-finally": true,
"no-unsafe-finally": "error",
// "no-unused-expression": true,
"no-unused-expression": "error",
// "no-use-before-declare": false, // disabled because it is very heavy performance-wise and not that useful
"@typescript-eslint/no-use-before-define": "off",
// "no-var-keyword": true,
"no-var": "error",
// "no-var-requires": true,
"@typescript-eslint/no-var-requires": "error",
// "object-literal-key-quotes": { options: "consistent-as-needed" },
"quote-props": ["error", "consistent-as-needed"],
// "object-literal-shorthand": true,
"object-shorthand": "error",
// "object-literal-sort-keys": true,
"sort-keys": "error",
// "one-line": {
// options: [
// "check-catch",
// "check-else",
// "check-finally",
// "check-open-brace",
// "check-whitespace"
// ]
// },
// Doesn't has any ESLint equivalent rule.
// "one-variable-per-declaration": { options: ["ignore-for-loop"] },
"one-var": "error",
// "only-arrow-functions": {
// options: ["allow-declarations", "allow-named-functions"]
// },
"prefer-arrow/prefer-arrow-functions": "error", // TODO: Probably not equivalent to TSLint's `only-arrow-functions`
// "ordered-imports": {
// options: {
// "import-sources-order": "case-insensitive",
// "module-source-path": "full",
// "named-imports-order": "case-insensitive"
// }
// },
"import/order": "error", // TODO: Probably not equivalent to TSLint's `ordered-imports`
// "prefer-const": true,
"prefer-const": "error",
// "prefer-for-of": true,
// Doesn't has any ESLint equivalent rule.
// quotemark: {
// options: ["double", "avoid-escape"]
// },
quotes: ["error", "double", { avoidEscape: true }],
// radix: true,
radix: "error",
// semicolon: { options: ["always"] },
semi: ["error", "always"],
// "space-before-function-paren": {
// options: {
// anonymous: "never",
// asyncArrow: "always",
// constructor: "never",
// method: "never",
// named: "never"
// }
// },
"space-before-function-paren": [
"error",
{
anonymous: 'never',
asyncArrow: 'always',
named: 'never',
},
anonymous: "never",
asyncArrow: "always",
named: "never"
}
],
'comma-dangle': ['error', 'always-multiline'],
eqeqeq: ['error', 'always', { null: 'ignore' }],
// typedef: 'off', // Doesn't has any ESLint equivalent rule
'@typescript-eslint/type-annotation-spacing': ['error', { before: false, after: true }],
'typeof-compare': 'off',
// 'unified-signatures': 'error', // Doesn't has any ESLint equivalent rule
'use-isnan': 'error',
camelcase: ['error', { allow: ['^([A-Z0-9]|[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$'] }], // PascalCase RegEx ref: https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-pascal-case.js#L16
'id-blacklist': [
'error',
'any',
'Number',
'number',
'String',
'string',
'Boolean',
'boolean',
'Undefined',
'undefined',
// "trailing-comma": {
// options: {
// esSpecCompliant: true,
// multiline: "always",
// singleline: "never"
// }
// },
"comma-dangle": ["error", "always-multiline"],
// "triple-equals": { options: ["allow-null-check"] },
eqeqeq: ["error", "always", { null: "ignore" }],
// typedef: false,
// Doesn't has any ESLint equivalent rule.
// "typedef-whitespace": {
// options: [
// {
// "call-signature": "nospace",
// "index-signature": "nospace",
// parameter: "nospace",
// "property-declaration": "nospace",
// "variable-declaration": "nospace"
// },
// {
// "call-signature": "onespace",
// "index-signature": "onespace",
// parameter: "onespace",
// "property-declaration": "onespace",
// "variable-declaration": "onespace"
// }
// ]
// },
"@typescript-eslint/type-annotation-spacing": [
"error",
{ before: false, after: true }
],
// whitespace: 'error', // Doesn't has any ESLint equivalent rule
},
}
// "typeof-compare": false, // deprecated in TSLint 5.9.0
"typeof-compare": "off",
// "unified-signatures": true,
// Doesn't has any ESLint equivalent rule.
// "use-isnan": true,
"use-isnan": "error",
// "variable-name": {
// options: ["ban-keywords", "check-format", "allow-pascal-case"]
// },
camelcase: [
"error",
{ allow: ["^([A-Z0-9]|[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$"] } // PascalCase RegEx ref: https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-pascal-case.js#L16
],
"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
]
// whitespace: {
// options: [
// "check-branch",
// "check-decl",
// "check-operator",
// "check-separator",
// "check-type",
// "check-typecast"
// ]
// },
// Doesn't has any ESLint equivalent rule.
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc