Why would TSLint report errors in files but not list the files - typescript1.8

I'm running tslint via Angular-CLI and running into an issue where it is detecting failures but not showing me what the failures are.
This is the only output I get:
C:\extras\code\gitlab\project-name>ng lint
> Project-Name#0.4.0 lint C:\extras\code\gitlab\project-name
> tslint "src/**/*.ts"
Lint errors found in the listed files.
Why would this happen & how do I fix it?

Looks like this is an error with Angular-CLI. If you run the command manually: npm run lint you can see the real error. I submitted an issue on GitHub.
Update: This has been fixed, but until a new version is released, changing the bottom of your tslint.json file to this will resolve it.
"use-host-property-decorator": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"no-attribute-parameter-decorator": true,
"no-input-rename": true,
"no-output-rename": true
Related GitHub commit: https://github.com/angular/angular-cli/pull/848/files#diff-53fb140e7018814de9f2e231a3eb95a1R65

Related

Nuxt: Command 'nuxt' not found - Output directory `dist/` does not exists

I have successfully created a Nuxt.js project with this configuration using the CLI:
Project name: test
Programming language: JavaScript
Package manager: Npm
UI framework: None
Nuxt.js modules: None
Linting tools: None
Testing framework: None
Rendering mode: Single Page App
Deployment target: Static (Static/JAMStack hosting)
Development tools: jsconfig.json
Version control system: Git
The developement server runs properly with npm run dev.
npm run build also runs without errors and tells me that:
Ready to run nuxt generate
But the execution of nuxt generate leads to the error Command 'nuxt' not found. This is strange because nuxt seems to be installed when I execute npm nuxt list.
I first reinstalled just nuxt and then all dependencies after deleting the node_modules/ folder, but the error remains the same. If I just run npm run start it tells me
Nuxt Fatal Error
Error: Output directory `dist/` does not exists, please use
`nuxt generate` before `nuxt start` for static target.
This is strange again because the .nuxt/dist/ folder exists.
Does anyone have an idea what is going wrong?
I have solved the problem. For me it works if I run npm run generate instead of nuxt generate.

Failed to load plugin 'import' declared in '... » eslint-config-standard': Cannot find module 'eslint-plugin-import'

I've been trying to use ESLint along with Standard and I haven't been able to get it to work. I've tried setting it up through eslint --init, uninstalling eslint globally and having all the packages locally, installing each package manually npm install --save-dev eslint eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node, reinstalling ESLint extension and nothing so far. I'm perfectly able to run ./node_modules/.bin/eslint --fix ... in order to fix/check errors but it doesn't work with the VSCode extension by any meanings. I don't have prettier so it isn't related to it either.
Output:
[Info - 12:33:20 AM] ESLint server is running.
[Info - 12:33:23 AM] ESLint library loaded from: c:\Users\h08FXplsV8\Documents\dev\node\graphql-bootcamp\graphql-prisma\node_modules\eslint\lib\api.js
[Error - 12:33:25 AM]
Failed to load plugin 'import' declared in 'graphql-prisma\.eslintrc » eslint-config-standard': Cannot find module 'eslint-plugin-import'
Require stack:
- C:\Users\h08FXplsV8\Documents\dev\node\graphql-bootcamp\__placeholder__.js
Happened while validating C:\Users\h08FXplsV8\Documents\dev\node\graphql-bootcamp\graphql-prisma\src\resolvers\index.js
This can happen for a couple of reasons:
- The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
- If ESLint is installed globally, then make sure 'eslint-plugin-import' is installed globally as well.
- If ESLint is installed locally, then 'eslint-plugin-import' isn't installed correctly.
.eslintrc:
{
"env": {
"es6": true,
"node": true
},
"extends": [
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
}
}
I've seen other questions in SO related to this issue but none of the solutions worked, unfortunately.
I had the same issue for many weeks and finally found this thread and comment on Github: https://github.com/microsoft/vscode-eslint/issues/696#issuecomment-542592372
My issue turned out to be related to subdirectories. As soon as I made the project the only open project with an .eslintrc.js file, all of my linting issues went away.
Hopefully this works for you.
To fix the dependency tree, try following these steps in the exact order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "babel-eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
Also, be sure, that you have latest version of "eslint-plugin-import" plugin, as in my case, for example i had this error with "2.20.1" version, but latest "2.25.3" solved this issue
I had the same error caused by the eslint-plugin-import dependency and in my case, I got rid of the error by increasing to the latest version of the package.
For those having the following error with flutter firebase cloud functions after running firebase init functions and trying to run firebase deploy --only functions:
ESLint: 8.9.0
Error: Failed to load plugin 'import' declared in '.eslintrc.js': Cannot find module 'es-abstract/2021/RequireObjectCoercible'
Require stack:
- C:\Users\xx\Documents\xx\xx\functions\node_modules\eslint-plugin-import\lib\ExportMap.js
- C:\Users\xx\Documents\xx\xx\functions\node_modules\eslint-plugin-import\lib\rules\named.js
- C:\Users\xx\Documents\xx\xx\functions\node_modules\eslint-plugin-import\lib\index.js
- C:\Users\xx\Documents\xx\xx\functions\node_modules\#eslint\eslintrc\dist\eslintrc.cjs
This was solved by:
delete node_modules in functions folder
delete package-lock.json in functions folder
cd .\functions\ in the terminal to get into functions folder, run npm i, cd ../
firebase deploy --only functions
I am having this issue too which was why I checked this post but did not see any answer that work for me. After searching online, I stumbled into this code which solves my problem.
npm i -D eslint #typescript-eslint/eslint-plugin
In my case, i was not using jest at all.
So i had to downgrade de eslint dev dependency:
"eslint": "^7.32.0",
as it say here: https://github.com/eslint/eslint/issues/15149#issuecomment-939501275

run sample test case of uiveri5 show error "Reference Error: describe is not defined"

I installed the #ui5/uiveri5 globally correctly. I download the ui-uiveri5 repository, then I go to directory of sample\apiTesting, and run the command
uiveri5 APITesting.spec
it report following error:
C:\src\open\ui5-uiveri5\sample\apiTesting\APITesting.spec.js:2
describe('APITesting', function() {
^
ReferenceError: describe is not defined
Please guide me on how to solve this issue. ( It report the same issue after I install the jasmine-node, mocha globally).
No need to install jasmine or mocha, just install uiveri5 globally with npm install #ui5/uiveri5 -g. Can you please try again, I merged a fix for another small issue. And with it, this sample starts fine.

Automatically fix lint problems only on a specific file

I am running npm run lint -- --fix from command line to automatically fix lint errors, but this command creates fixes on the entire project.
I've been searching the documentation to find out how to run the automatic fix on a specific file instead of the entire project, but I couldn't find a way.
Is this possible?
Using ESLint from the CLI should fix it:
eslint --fix "C:\code\hello-world.js"
ESLint CLI documentation
The solution works great, this is just a quick tip for yarn/mac users:
yarn eslint --fix "src/ui/screens/HelloWorld.js"

sublime linter stopped working for lesshint when .lesshintrc file added in project root directory

I have installed lesshint via npm
npm install lesshint -g
installed sublimeLinter and than sublimeLinter-contrib-lesshint package and the linter is enabled.
now whenever I open any .less file in sublime, linter gives all kind of warning such as SpaceAfterPropertyColon , SingleQuots , ZeroWidth and much more which is the default behavior.
Now I tried to configure the linter according to my need in the project, so added the .lesshintrc file in project root directory and restart the sublime text 3.
BUT now everything stopped working, no linting error coming up. even I tried to set error explicitly in the .less file. There is no error in the sublime console too.
on other hand, inline linting configuration works fine by putting rules the on top in any file such as
//lesshint-disable importantRule, propertyOrdering, emptyRule
What could be the issue?
Below is the system detail and .lesshintrc file content.
macOS 10.13.1
sublime text 3 build 3143
node v 8.9.2
.lesshintrc
{
"fileExtensions": [".less", ".css"],
"excludedFiles": ["vendor.less"],
"spaceAfterPropertyColon": {
"enabled": true,
"style": "one_space"
},
"singleLinePerSelector": false,
"propertyOrdering": false,
"importantRule": false
}
Lead maintainer of lesshint here.
This was caused by an regression in lesshint, but is fixed in lesshint#4.6.3.
Run npm install -g lesshint again and things should work as expected.