Coder Social home page Coder Social logo

linter-tslint's Introduction

Travis Version Downloads

linter-tslint

This linter plugin for AtomLinter provides an interface to tslint. It will be used with files that have the "TypeScript" or "TypeScriptReact" syntax.

Installation

On first activation the plugin will install all dependencies automatically, you no longer have to worry about installing Linter.

Plugin installation

$ apm install linter-tslint

Settings

You can configure linter-tslint by editing ~/.atom/config.cson (choose Config... in Atom menu):

'linter-tslint':
  # Custom rules directory (absolute path)
  rulesDirectory: "/path/to/rules"
  # Try using the local tslint package (if exist)
  useLocalTslint: true
  # Enable semantic rules
  enableSemanticRules: true

Contributing

If you would like to contribute enhancements or fixes, please do the following:

  1. Fork the plugin repository.
  2. Hack on a separate topic branch created from the latest master.
  3. Commit and push the topic branch.
  4. Make a pull request.
  5. welcome to the club

Please note that modifications should follow these coding guidelines:

  • Indent is 2 spaces.
  • Code should pass coffeelint linter.
  • Vertical whitespace helps readability, don’t be afraid to use it.

Thank you for helping out!

linter-tslint's People

Contributors

aminya avatar arcanemagus avatar arusakov avatar buzinas avatar csnover avatar danielmoore avatar david-driscoll avatar despairblue avatar drieks avatar greenkeeper[bot] avatar greenkeeperio-bot avatar guncha avatar hd-deman avatar keplersj avatar kevinsawicki avatar lijunle avatar maistho avatar pajn avatar park9140 avatar pborreli avatar pwnall avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar smhxx avatar smockle avatar snowyu avatar steelbrain avatar timkendrick avatar xapphire13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

linter-tslint's Issues

Warning is placed to the line above right place

When i use the new namespace keyword instead of module, the warnings aren't placed to the right line.
See in the example: the variable name news_List in line 5. is invalid, it should be newsList. The warning (variable name must be in camelcase or uppercase) is placed to line 4.
screen shot 2015-06-16 at 18 56 38

If i use module instead of namespace everything works fine.

TSLint 4.0 support

Hi, as a user of this plugin I saw in package.json that it currently uses tslint 3.15.

How can I update it to use tslint 4.0?

Will it work out of the box? Could you perhaps make a release with tslint 4.0?

Ps. I see that other projects are currently migrating to tslint. Two examples: Codelyzer and gulp-tslint

error finding tslint when installed globally

Hey tslint,

Perhaps this is a nonissue but, I'm having issues using the recommended lint specs when tslint is only installed globally. The linter throws this error:

Error: Invalid "extends" configuration value - could not require "tslint:recommended". Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.

See screenshot:
screenshot from 2016-07-07 14 11 29

I did get it to work with a local tslint installation.

"The linter binary 'tslint' cannot be found."

I keep getting the error: The linter binary 'tslint' cannot be found. Linting has been halted. Please install the linter binary or disable the linter plugin depending on it. Make sure to reload Atom to detect changes

I have confirmed that the tslint binary is in the linter-tslint/node_modules/tslint/bin/ directory, and I even tried installing tslint globally and setting the path in my Atom config accordingly to no avail. I'm running OS X Yosemite.

Any idea what I'm missing here?

Highlighting in the editor messing up with line numbers

Using latest versions of Atom and packages.

Here a warning is produced:
screenshot 2015-05-14 16 58 57

But when you place a cursor on it, that's the message you get:
screenshot 2015-05-14 16 59 08

Which apparently is related to the next line in the editor (19).

Running tslint manually though shows the information properly:

src/index.ts[19, 11]: expected variable-declaration: 'stripe' to have a typedef

So I guess it's a problem with either linter or linter-tslint. Would appreciate any help.

Linter version is version locked with plugin version

In fixing the linter to the new api I used the core linter directly via npm. Need to add the ability to use any version of the linter that has the open api added in version 2.4 of tslint. (api may have been added earlier)

Uncaught Error: Cannot find module './isBlank'

[Enter steps to reproduce below:]

  1. Open a .ts file from the RxJS source repo.

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: linter-tslint package, v0.10.0

Stack Trace

Uncaught Error: Cannot find module './isBlank'

At module.js:340

Error: Cannot find module './isBlank'
    at Module._resolveFilename (module.js:338:15)
    at Function.Module._resolveFilename (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexeden/Google Drive/code/rxjs/node_modules/tslint/node_modules/underscore.string/index.js:21:22)
    at Module._compile (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexeden/Google Drive/code/rxjs/node_modules/tslint/lib/formatterLoader.js:4:27)
    at Module._compile (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexeden/Google Drive/code/rxjs/node_modules/tslint/lib/tslint.js:5:25)
    at Module._compile (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at /Users/alexeden/enveq/share/atom/packages/linter-tslint/lib/init.coffee:62:22
    at /Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:44:21
    at ondir (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:187:31)
    at /Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:153:39
    at onex (/Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:93:22)
    at /Users/alexeden/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:24:18
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

Config

{
  "core": {
    "allowPendingPaneItems": false,
    "audioBeep": false,
    "autoHideMenuBar": true,
    "disabledPackages": [
      "atom-ternjs",
      "auto-reveal-in-sidebar",
      "atom-htmltidy",
      "api-workbench",
      "linter-sass-lint",
      "linter-scss-lint",
      "atom-wallaby"
    ],
    "excludeVcsIgnoredPaths": false,
    "ignoredNames": [
      ".git",
      ".hg",
      ".svn",
      ".DS_Store",
      "._*",
      "Thumbs.db",
      "node_modules",
      "bower_components",
      "webpack*stats.json"
    ],
    "openEmptyEditorOnStart": false,
    "packagesWithKeymapsDisabled": [
      "remote-sync",
      "atom-htmltidy",
      "terminal-plus",
      "markdown-preview"
    ],
    "projectHome": "/home/alexander/Google\\ Drive/code",
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ]
  }
}

Installed Packages

# User
atom-jade, v0.3.0
atom-material-syntax, v0.4.6
atom-material-ui, v1.2.13
atom-typescript, v8.11.0
autocomplete-paths, v1.0.2
editorconfig, v1.4.1
file-icons, v1.7.14
indent-guide-improved, v1.4.9
language-elm, v1.5.0
language-haskell, v1.7.17
linter, v1.11.10
linter-eslint, v7.2.2
linter-jade, v0.3.2
linter-jsonlint, v1.2.5
linter-stylelint, v2.11.0
linter-tslint, v0.10.0
markdown-scroll-sync, v2.1.2
markdown-themeable-pdf, v1.0.1
minimap, v4.24.6
pigments, v0.29.2
pretty-json, v1.4.1
tree-view-breadcrumb, v0.8.1

# Dev
No dev packages

Implement specs

It looks like this linter does not currently have any specs written for it, adding it to the list being maintained here for tracking.

Specs do not need to be super detailed, as they should mainly test whether the package is properly running the linter plugin and parsing its messages. Leave testing of the linter functionality to the author of the linter.

If you need any help feel free to ask!

config is ignored

here is part of my config.cson:

"linter-tslint":
"quotemark": [
true
"single"
]

still, get lots of error for "double quotemarks"

linter-tslint not able to find custom rules after upgrade to 0.9.0+

I upgraded my linter-tslint from 0.8.3 to 0.9.1 today and since then, linter-tslint is unable to find my custom rules. I have updated the path to absolute path. But it is not working even then.

Following is the error that I am getting:
Could not find the following rules specified in the configuration: _List of custom rules_

Upgraded the path from /src/tslint_rules to /Users/xxx/xxx/src/tslint_rules

I also have useLocalTslint set to true. Locally, I have tslint version 3.6.0-dev.1 running.

Any help is much appreciated.

Thanks.

Search nearest tslint.json

Currently, tslint.json seams to be searched in two locations:
1.) In the same directory as the ts-File.
2.) In the home directory of the user

It would be nice if tslint.json could also be located by searching in the "nearest" directories. This is what for example the gulp-tslint plugin does.
It allows to have tslint.json in the project directory but having ts-Files in (nested) subdirectories of the project directory.
So, it would be easier to keep the warnings an errors in sync between the (gulp-)build and atom.

Uncaught SyntaxError: Unexpected end of input

[Enter steps to reproduce below:]

  1. Just updated the plugin, first thing I saw
  2. On this Line: permissions: IPermissionsDA
  3. Missing semicolumn

Atom Version: 1.0.0
System: Mac OS X 10.10.3
Thrown From: linter-tslint package, v0.2.2

Stack Trace

Uncaught SyntaxError: Unexpected end of input

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2FUsers%2Ftomi%2FDocuments%2FProgramming%2FGithub%2FHugosAwesomeWorld%22%7D%5D%2C%22bootstrapScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Fwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22appVersion%22%3A%221.0.0%22%2C%22shellLoadTime%22%3A313%2C%22initialPaths%22%3A%5B%22%2FUsers%2Ftomi%2FDocuments%2FProgramming%2FGithub%2FHugosAwesomeWorld%22%5D%7D:0

SyntaxError: Unexpected end of input
  at Object.parse (native)
  at LinterTslint.processMessage (/Users/tomi/.atom/packages/linter-tslint/lib/linter-tslint.coffee:46:34)
  at /Users/tomi/.atom/packages/linter/lib/linter.coffee:182:8
  at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:213:47)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:227:18
  at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:98:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:166:7)
  at Pipe.close (net.js:464:12)

Commands

  3x -0:06.1.0 core:backspace (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-monokai"
    ],
    "disabledPackages": [
      "better-handlebars",
      "preview-plus",
      "tree-view-git-status",
      "sublime-tabs",
      "tab-history",
      "atom-handlebars",
      "meteor-helper",
      "enhanced-tabs",
      "close-tags",
      "linter"
    ],
    "ignoredNames": [
      ".settings",
      ".idea",
      ".git",
      ".DS_Store",
      "node_modules",
      "js",
      ".tmp",
      "documentation",
      ".meteor",
      ".build*",
      ".npm"
    ],
    "excludeVcsIgnoredPaths": false
  },
  "linter-tslint": {
    "tslintExecutablePath": "/usr/local/bin/tslint"
  }
}

Installed Packages

# User
.bin, vundefined
Handlebars, v1.1.2
atom-html-preview, v0.1.8
atom-jasmine, v0.6.0
atom-monokai, v0.8.0
atom-typescript, v4.6.6
autoclose-html, v0.18.0
build, v0.38.0
docblockr, v0.7.2
linter, v1.0.5
linter-tslint, v0.2.2
project-manager, v1.15.10
recent-files-fuzzy-finder, v0.1.4
zentabs, v0.8.4

# Dev
No dev packages

Object.activate is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/AtomLinter/Linter/wiki/Migrating-to-the-new-API

Object.activate (C:\Users\t-thangu\.atom\packages\linter\lib\main.coffee:57:8)
Package.activateNow (C:\Users\t-thangu\AppData\Local\atom\app-1.0.2\resources\app.asar\src\package.js:240:19)
<unknown> (C:\Users\t-thangu\AppData\Local\atom\app-1.0.2\resources\app.asar\src\package.js:221:30)
Package.measure (C:\Users\t-thangu\AppData\Local\atom\app-1.0.2\resources\app.asar\src\package.js:165:15)
Package.activate (C:\Users\t-thangu\AppData\Local\atom\app-1.0.2\resources\app.asar\src\package.js:213:14)
PackageManager.activatePackage (C:\Users\t-thangu\AppData\Local\atom\app-1.0.2\resources\app.asar\src\package-manager.js:452:21)

tslint.json in project root ignored

I have tslint.json in the project root, which is also the working directory.

However, the linting is not active, and the console log says:
Error: ENOENT, no such file or directory '/Users/mike/tslint.json'

In other words, it only is looking for the file in the user home directory and ignoring the project root. Adding ~/tslint.json makes it work.

Package.getActivationCommands is deprecated.

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (C:\Users\fango_000\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:790:9)
Package.hasActivationCommands (C:\Users\fango_000\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:715:20)
<unknown> (C:\Users\fango_000\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:169:24)
Package.measure (C:\Users\fango_000\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:147:15)

tslint-dep

Single quote option

There should be a settings option for choosing to use single quote character instead of double quote character.

image

Add a rulesDirectory property

Today, we call the TSLint's Linter construction as follows:

linter = new Linter(filePath, text, {
  formatter: 'json',
  configuration: configuration
});

But there is also a rulesDirectory property for custom rules created by users.

Could you please add a parameter to the plugin, so we can set this parameter?

Could not find the following rules specified in the configuration: no-trailing-comma

Hi, I've the followin error message:

Error: Could not find the following rules specified in the configuration: no-trailing-comma
Error: Could not find the following rules specified in the configuration:
no-trailing-comma
    at Object.loadRules (C:\Users\MY_USERNAME\.atom\packages\linter-tslint\node_modules\tslint\lib\ruleLoader.js:29:15)
    at Linter.lint (C:\Users\MY_USERNAME\.atom\packages\linter-tslint\node_modules\tslint\lib\tslint.js:24:44)
    at file:///C:/Users/MY_USERNAME/.atom/packages/linter-tslint/lib/init.coffee:87:31

how to set global tslint.json by url?

Hello! Thank you for this project.
We created public service which response our common tslint.json
In webstorm tslint we can provide http path to our tslint, but in atom we cant/ how to do?
Thank you!

Uncaught EvalError

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

Getting this error whenever I'm using linter-tslint

Setting to specify path to tslint.json

I have my tslint.json under a config folder in my project, seems like the atom linter is expecting it to be at the root.

I don't see any configuration for this, can we get a config point / is there anything I can do for this project?

Refused to evaluate a string as JavaScript because 'unsafe-eval'

linter-tslint: 0.11.1
typescript: 2.0.3

Information:

  1. tslint works well on CLI.
  2. Error pop ups on file save.
  3. This error only appears in my angular2 project. In other typescript projects tslint works well.
EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
    at Object.<anonymous> (C:\Users\Artur\Desktop\FTP - dunthag-client\node_modules\typescript\lib\typescript.js:60881:23)
    at Module._compile (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:50:27)
    at Object.<anonymous> (C:\Users\Artur\Desktop\FTP - dunthag-client\node_modules\codelyzer\importDestructuringSpacingRule.js:7:10)
    at Module._compile (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (C:\Users\Artur\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:50:27)
    at loadRule (C:\Users\Artur\.atom\packages\linter-tslint\node_modules\tslint\lib\ruleLoader.js:65:26)
    at findRule (C:\Users\Artur\.atom\packages\linter-tslint\node_modules\tslint\lib\ruleLoader.js:46:20)
    at Object.loadRules (C:\Users\Artur\.atom\packages\linter-tslint\node_modules\tslint\lib\ruleLoader.js:14:24)
    at Linter.lint (C:\Users\Artur\.atom\packages\linter-tslint\node_modules\tslint\lib\tslint.js:56:44)
    at file:///C:/Users/Artur/.atom/packages/linter-tslint/lib/init.coffee:103:31

Does this work on windows?

I have been trying to get this working in windows 7. Not working for me. Nothing in debugger except 2 depreciation messages related to linter.

I got latest linter and tslint installed. tslint works from command line just fine. do i need anything else? linter is fine as well as it works for atom-typescript.

Tried different config file, but tslint is already in my path so following config doesn't make any difference.

"linter-tslint":
tslintExecutablePath: "C:/Users/user1/AppData/Roaming/npm/node_modules/tslint/bin/tslint"

Not working

This linter doesn't seem to be working for me (OS X, latest Atom version). I noticed when I check the dev console it shows:

activate linter-clang
activate linter-csslint
activate linter-javac
activate linter-jshint
activate linter-php
Linter-Pylint: package loaded, ready to get initialized by AtomLinter.
activate linter-rubocop
activate linter-shellcheck
activate linter-xmllint

But no linter-tslint. Not sure if this is an Atom issue, a linter-tslint issue, or if something is set up wrong on my end.

LinterTslint.Linter is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/AtomLinter/Linter/wiki/Migrating-to-the-new-API

LinterTslint.Linter (/Users/czottmann/Settings/Atom/packages/linter/lib/linter.coffee:60:4)
new LinterTslint (/Users/czottmann/Settings/Atom/packages/linter-tslint/lib/linter-tslint.coffee:26:4)
Object.lint (/Users/czottmann/Settings/Atom/packages/linter/lib/legacy.coffee:61:21)
<unknown> (/Users/czottmann/Settings/Atom/packages/linter/lib/editor-linter.coffee:69:25)
currentLinter (/Users/czottmann/Settings/Atom/packages/linter/lib/editor-linter.coffee:68:19)
<unknown> (/Users/czottmann/Settings/Atom/packages/linter/lib/editor-linter.coffee:82:22)

TypeError: Cannot read property 'length' of undefined

This error append when I'm writing the as of an import statement :

import {
    List,
    PayloadInterface as|
} from "../../../Console/Responders/Projects/Project/List";
TypeError: Cannot read property 'length' of undefined
    at NoUseBeforeDeclareWalker.validateUsageForVariable (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/build/rules/noUseBeforeDeclareRule.js:90:41)
    at NoUseBeforeDeclareWalker.visitNamedImports (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/build/rules/noUseBeforeDeclareRule.js:69:18)
    at NoUseBeforeDeclareWalker.SyntaxWalker.visitNode (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49698:26)
    at NoUseBeforeDeclareWalker.ScopeAwareRuleWalker.visitNode (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49900:40)
    at /home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49776:67
    at visitNode (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:7197:20)
    at Object.forEachChild (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:7471:21)
    at NoUseBeforeDeclareWalker.SyntaxWalker.walkChildren (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49776:16)
    at NoUseBeforeDeclareWalker.SyntaxWalker.visitNode (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49770:26)
    at NoUseBeforeDeclareWalker.ScopeAwareRuleWalker.visitNode (/home/ascarius/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:49900:40)

Uncaught Error: Cannot find module 'typescript'

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.6.0
System: Mac OS X 10.11.4
Thrown From: linter-tslint package, v0.9.0

Stack Trace

Uncaught Error: Cannot find module 'typescript'

At module.js:338

Error: Cannot find module 'typescript'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/kerbyfc/node_modules/tslint/lib/language/utils.js:3:10)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/kerbyfc/node_modules/tslint/lib/tslint.js:2:15)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at /Users/kerbyfc/.atom/packages/linter-tslint/lib/init.coffee:62:22
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:44:21
    at ondir (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:187:31)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:153:39
    at onex (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:93:22)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:24:18
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

     -0:05.1.0 linter:lint (atom-text-editor.editor.vim-mode.normal-mode.is-focused)

Config

{
  "core": {
    "audioBeep": false,
    "automaticallyUpdate": false,
    "destroyEmptyPanes": false,
    "disabledPackages": [
      "wrap-guide",
      "welcome",
      "update-package-dependencies",
      "styleguide",
      "whitespace",
      "tabs"
    ],
    "excludeVcsIgnoredPaths": false,
    "packagesWithKeymapsDisabled": [
      "tab-switcher"
    ],
    "themes": [
      "one-light-ui",
      "base16-tomorrow-light-theme"
    ],
    "ignoredNames": [
      "*.DS_Store",
      ".git"
    ]
  },
  "linter-tslint": {}
}

Installed Packages

# User
atom-typescript, v8.4.0
autocomplete-modules, v1.4.1
autocomplete-paths, v1.0.2
color-picker, v2.1.1
compare-files, v0.6.2
cursor-history, v0.5.9
docblockr, v0.7.3
easy-motion-redux, v1.0.0
editorconfig, v1.2.4
file-icons, v1.6.19
git-diff-details, v1.0.0
highlight-line, v0.11.1
linter, v1.11.4
linter-tslint, v0.9.0
local-settings, v0.4.0
minimap, v4.21.0
minimap-autohide, v0.10.1
minimap-find-and-replace, v4.5.0
minimap-split-diff, v0.3.0
nerd-treeview, v0.4.2
pane-info, v1.0.0
pretty-json, v0.4.1
project-manager, v2.7.6
raml, v0.2.0
smart-tab-name, v1.0.5
space-tab, v0.4.2
tab-length, v0.1.0
tabs-to-spaces, v1.0.2
text-manipulation, v0.6.0
trailing-spaces, v0.3.2
tree-view-git-status, v0.2.3
vim-mode, v0.65.0
vim-surround, v0.8.1

# Dev
No dev packages

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an al...

  1. Create an empty project directory
  2. npm init
  3. npm install tslint@next typescript@next --save
  4. Open any Typescript file in the project

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: linter-tslint package, v0.10.0

Stack Trace

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

At /Users/gunca/Code/tslint-repro/node_modules/typescript/lib/typescript.js:59692

EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

    at Function (native)
    at Object.<anonymous> (/Users/gunca/Code/tslint-repro/node_modules/typescript/lib/typescript.js:59692:23)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/gunca/Code/tslint-repro/node_modules/tslint/lib/tslint.js:2:10)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at /Users/gunca/.atom/packages/linter-tslint/lib/init.coffee:62:22
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:44:21
    at ondir (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:187:31)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:153:39
    at onex (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:93:22)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/resolve/lib/async.js:24:18
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

Config

{
  "core": {
    "projectHome": "/Users/gunca/Code"
  }
}

Installed Packages

# User
atom-typescript, v10.1.4
atomatigit, v1.5.5
autocomplete-clang, v0.9.4
autocomplete-go, v1.1.0
builder-go, v1.0.0
color-picker, v2.2.2
go-config, v1.2.1
go-get, v1.0.3
go-plus, v4.1.0
gofmt, v1.1.6
gometalinter-linter, v1.1.0
gorename, v1.0.2
hyperclick, v0.0.37
language-diff, v0.4.0
language-graphql, v0.2.0
language-haml, v0.24.0
language-javascript-jsx, v0.3.7
language-llvm, v0.1.1
language-rust, v0.4.6
last-cursor-position, v0.9.0
linter, v1.11.14
linter-rust, v0.4.6
linter-tslint, v0.10.0
navigator-godef, v1.0.3
recent-projects, v0.11.2
tester-go, v1.0.4

# Dev
No dev packages

Performance issues with multiple rules

If i write something i get a 1-2 sec lag.

Here is the timeline for reference it happens if i stop writing, and start writing again.
screenshot from 2016-05-24 14-47-46

It looks like the process is syncron with atom, and tslint will take a little bit to complete the linting, so in this time atom freezes.

Support for tsx

tsx support is rolled out in tslint package from version 2.5.0. It would be great if you could upgrade the package.json with the latest tslint version.

Failed to activate the linter-tslint package

[Enter steps to reproduce below:]

  1. Start Atom app

Atom Version: 1.7.3
System: Mac OS X 10.11.4
Thrown From: linter-tslint package, v0.9.3

Stack Trace

Failed to activate the linter-tslint package

At Cannot find module 'tslint'

Error: Cannot find module 'tslint'
    at Module._resolveFilename (module.js:338:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.module.exports.provideLinter (/Users/kematzy/.atom/packages/linter-tslint/lib/init.coffee:69:18)
    at Package.module.exports.Package.activateServices (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:349:69)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:186:16)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:156:32
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:149:26
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:146:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:538:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:519:29
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:337:18)
    at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:514:19)
    at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:497:46)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:754:28

Commands

Config

{
  "core": {
    "disabledPackages": [
      "autoclose-html",
      "pigments"
    ],
    "ignoredNames": [
      ".git",
      ".DS_Store",
      ""
    ]
  }
}

Installed Packages

# User
angularjs, v0.3.4
atom-bootstrap4, v1.4.0
atom-typescript, v8.9.1
autocomplete-ruby, v0.1.0
color-picker, v2.1.1
column-select, v0.2.0
emmet, v2.4.3
file-icons, v1.7.10
highlight-selected, v0.11.2
inline-autocomplete, v1.1.0
javascript-snippets, v1.2.1
language-apache, v1.5.0
language-liquid, v0.4.0
linter, v1.11.4
linter-erb, v1.0.2
linter-js-yaml, v1.2.5
linter-rubocop, v0.4.7
linter-ruby, v1.2.2
linter-sass-lint, v1.4.3
linter-tslint, v0.9.3
minitest-snippets, v0.2.0
open-recent, v5.0.0
ruby-slim, v0.2.0
ruby-syntax-replacer, v0.5.1
term3, v0.22.0
v-bootstrap4, v0.1.7

# Dev
No dev packages

Error: formatter 'json' not found

I got the following error in Atom when opening a TS file: Error: formatter 'json' not found. (See trace below.)

I use Windows 8.1, I have tslint available in the PATH. I have installed linter-jsonlint, linter-tslint, linter-eslint and of course the linter package. Plus atom-typescript and others. What's the problem?

Error: formatter 'json' not found
  at Linter.lint (C:\Users\G\.atom\packages\linter-tslint\node_modules\tslint\lib\tslint.js:50774:23)
  at Object.provider.lint (C:\Users\G\.atom\packages\linter-tslint\lib\init.coffee:24:23)
  at promises.push.Promise.then._this.emitter.emit.linter (C:\Users\G\.atom\packages\linter\lib\linter-registry.js:95:28)
  at C:\Users\G\.atom\packages\linter\lib\linter-registry.js:94:25
  at Set.forEach (native)
  at LinterRegistry.lint (C:\Users\G\.atom\packages\linter\lib\linter-registry.js:92:20)
  at C:\Users\G\.atom\packages\linter\lib\linter.coffee:98:16
  at Emitter.module.exports.Emitter.emit (C:\Users\G\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at EditorLinter.lint (C:\Users\G\.atom\packages\linter\lib\editor-linter.js:189:20)
  at Commands.lint (C:\Users\G\.atom\packages\linter\lib\commands.coffee:60:40)
  at atom-workspace.Commands.subscriptions.add.atom.commands.add.linter:lint (C:\Users\G\.atom\packages\linter\lib\commands.coffee:13:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\G\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (C:\Users\G\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\G\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:145:19)
  at Object.triggerLinter (C:\Users\G\.atom\packages\atom-typescript\dist\main\atom\atomUtils.js:229:19)
  at C:\Users\G\.atom\packages\atom-typescript\dist\main\atomts.js:59:27

Would you please add a changelog for releases?

Would you please be so good as to add a CHANGELOG.md to this repository for each release. Right now, even looking at your code releases, it is impossible to tell what has be added and/or fixed in each release. This would be most helpful. Thank you in advance.

best,

β€” faddah
portland, oregon, u.s.a.

Question: when releases are made?

Although my issue was closed and my pull request was merged, the current linter-tslint package is the same as before. Is there anything wrong or there is some delay between the merge and the next release?

Could not find the following rules specified in the configuration

Hi, I get this error from atom:

Error: Could not find the following rules specified in the configuration: new-parens no-default-export one-variable-per-declaration
Error: Could not find the following rules specified in the configuration:
new-parens
no-default-export
one-variable-per-declaration
    at Object.loadRules (/Users/adam/.atom/packages/linter-tslint/node_modules/tslint/lib/ruleLoader.js:29:15)
    at Linter.lint (/Users/adam/.atom/packages/linter-tslint/node_modules/tslint/lib/tslint.js:26:44)
    at /Users/adam/.atom/packages/linter-tslint/lib/init.coffee:101:31

No error from command line running tslint -c tslint.json src/app/settings.ts

tslint -v shows 2.10.2
atom version of linter-tslint shows 0.9.3
atom version of linter shows 1.11.4

I checked the latest tslint rules and the three rules in the error are valid rule names.

Any ideas what else I can check?

Add specs

This package needs some specs to at the least test basic functionality.

Package.activateConfig is deprecated.

Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/package.js:247:11)
Package.activateNow (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/package.js:218:14)
<unknown> (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/package.js:203:30)
Package.measure (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)

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.