GithubHelp home page GithubHelp logo

jameshenry / eslint-plugin-tslint Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 3.0 227 KB

:sparkles: A plugin which allows you to run a full instance of TSLint within ESLint

Home Page: https://jameshenry.blog

License: MIT License

JavaScript 3.93% TypeScript 96.07%
eslint eslint-plugin-tslint plugin tslint typescript

eslint-plugin-tslint's People

Contributors

greenkeeper[bot] avatar jameshenry avatar semantic-release-bot avatar unlight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-plugin-tslint's Issues

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

I get into trouble,thanks for your help

I use this plugin in eslint,but there is a trouble when export enum . How can i fix this! Thx!


 http://eslint.org/docs/rules/  Parsing error: Unexpected token

> 1 | export enum WeekdayType {
    |             ^
  2 |   SundayIsFirst,
  3 |   MondayIsFirst
  4 | }

Severity?

$ ./node_modules/.bin/eslint -f compact src/Grid.tsx
Error: /path/to/.eslintrc:
        Configuration for rule "tslint/config" is invalid:
        Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '{ lintFile: "./tslint.json", configFile: "./tsconfig.json" }').

.eslintrc:

  "rules": {
    "tslint/config": {
      "lintFile": "./tslint.json",
      "configFile": "./tsconfig.json"
    }  
  }

eslint-plugin-tslint version 3.1.0

I can't see anything about severity in the example in the readme. Any ideas please?

No output.

I'm on the latest everything.

There only JS-specific output, but nothing about tslint rules. If I remove the tslint plugin, it's the same output, as if tslint plugin isn't doing anything.

Probably needs an update for the latest eslint and/or typescript parser.

Add tslint rule name to out message

For easy configure and detect what kind of rule complains.

D:\My\Dev\nest-typescript-starter\app\cat\cat.controller.spec.ts
  15:60  warning  Missing trailing comma  tslint/config

D:\My\Dev\nest-typescript-starter\app\core\middlewares\logger.middleware.ts
  9:13  warning  Calls to 'console.log' are not allowed  tslint/config

D:\My\Dev\nest-typescript-starter\app\core\pipes\transform-object.pipe.ts
  6:1  warning  Consecutive blank lines are forbidden  tslint/config

D:\My\Dev\nest-typescript-starter\app\database\database.providers.ts
  14:13  warning  Missing trailing comma  tslint/config

D:\My\Dev\nest-typescript-starter\app\home\home.service.ts
  8:19  warning  block is empty  tslint/config

? 5 problems (0 errors, 5 warnings)

Want something like:

D:\My\Dev\nest-typescript-starter\app\home\home.service.ts
  8:19  warning  block is empty (no-empty) tslint/config

Support tsx

tslint wrapper consider all files as ts
Because of this string:

var fakeFilename = 'eslint.ts';

which leads to false warning
no-angle-bracket-type-assertion (and other) for

<main></main>

It's not assertion, it's jsx syntax.

Warning: The X rule requires type information

Warning: The 'no-use-before-declare' rule requires type information.
Warning: The 'await-promise' rule requires type information.
Warning: The 'match-default-export-name' rule requires type information.
Warning: The 'no-floating-promises' rule requires type information.
Warning: The 'no-for-in-array' rule requires type information.
Warning: The 'no-unsafe-any' rule requires type information.
Warning: The 'promise-function-async' rule requires type information.
Warning: The 'restrict-plus-operands' rule requires type information.
Warning: The 'strict-boolean-expressions' rule requires type information.
Warning: The 'completed-docs' rule requires type information.
Warning: The 'no-unnecessary-qualifier' rule requires type information.
Warning: The 'no-void-expression' rule requires type information.

For such rules ts.Program instance is required
https://palantir.github.io/tslint/usage/type-checking/

Can you add support?

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Documentation

It would be great if there was more information about how this works (how is it similar or different from eslint-plugin-typescript) and an installation documentation somewhere.

Linting Vue file

Hi, thanks for the awesome work. As rules, override any "extends", currently my vue files are not linted properly.
image

here is .eslintrc

{
  "env": {
    "browser": true,
    "commonjs": true,
    "es6": true,
    "node": true,
    "jest": true
  },
  "plugins": [
    "import",
    "html",
    "typescript",
    "tslint"
  ],
  "parser": "vue-eslint-parser",
  "parserOptions": {
    "parser": "typescript-eslint-parser",
    "sourceType": "module",
    "ecmaVersion": 2018,
    "ecmaFeatures": {
      "globalReturn": false,
      "impliedStrict": false,
      "jsx": false
    }
  },
  "root": true,
  "extends": [
    "airbnb-base",
    "typescript",
    "plugin:prettier/recommended",
    "plugin:vue/recommended"
  ],
  "settings": {
    "html/indent": "+2",
    "import/resolver": {
      "node": true,
      "eslint-import-resolver-typescript": true,
      "webpack": {
        "config": {
          "resolve": {
            "extensions": [
              ".js",
              ".ts",
              ".vue"
            ]
          }
        }
      }
    }
  },
  "rules": {

    "import/no-named-as-default": 0,
    "prettier/prettier": {
      "trailingComma": "all"
    },
    "comma-dangle": 2,
    "vue/html-closing-bracket-newline": [
      "error",
      {
        "singleline": "never",
        "multiline": "always"
      }
    ],
    "vue/max-attributes-per-line": [
      "error",
      {
        "singleline": 4,
        "multiline": {
          "max": 1,
          "allowFirstLine": false
        }
      }
    ],
    "vue/require-default-prop": false,
    "printWidth": 160,
    "indent": [
      "error",
      2
    ],
    "linebreak-style": "error",
    "no-multiple-empty-lines": [
      "error",
      {
        "max": 1,
        "maxEOF": 0
      }
    ],
    "object-curly-newline": [
      "error",
      {
        "multiline": true
      }
    ],
    "comma-spacing": [
      "error",
      {
        "before": false,
        "after": true
      }
    ],
    "no-trailing-spaces": "error",
    "no-console": "warn",
    "semi": "error",
    "quotes": [
      "error",
      "double"
    ],
    "object-curly-spacing": [
      "error",
      "always"
    ],
    "space-before-blocks": [
      "error",
      {
        "functions": "always",
        "keywords": "always",
        "classes": "never"
      }
    ],
    "no-unused-vars": "error",
    "typescript/no-unused-vars": "error",
    "require-jsdoc": [
      "error",
      {
        "require": {
          "FunctionDeclaration": true,
          "MethodDefinition": true,
          "ClassDeclaration": true,
          "ArrowFunctionExpression": true,
          "FunctionExpression": false
        }
      }
    ],
    "tslint/config": ["warn", {
      "lintFile": "./tslint.json"}]
  }
}

Is there any workaround, or fix for this? Much appreciated for your hard work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.