lint-staged

lint-staged not running on precommit

大城市里の小女人 提交于 2020-05-10 07:25:30
问题 prettier is not running on precommit. This worked with the same configuration in other projects, so I'm baffled why it's not working this time. This is the relevant section of my package.json file: "scripts": { "precommit": "lint-staged" }, "lint-staged": { "*.{js,json,css,scss,html,md}": [ "prettier --write", "git add" ] }, Edit. Here are the relevant devDependencies: "devDependencies": { "husky": "^0.14.3", "lint-staged": "^7.0.4", "prettier": "1.12.0" }, 回答1: The problem for me was I ran "

lint-staged not running on precommit

走远了吗. 提交于 2020-05-10 07:25:10
问题 prettier is not running on precommit. This worked with the same configuration in other projects, so I'm baffled why it's not working this time. This is the relevant section of my package.json file: "scripts": { "precommit": "lint-staged" }, "lint-staged": { "*.{js,json,css,scss,html,md}": [ "prettier --write", "git add" ] }, Edit. Here are the relevant devDependencies: "devDependencies": { "husky": "^0.14.3", "lint-staged": "^7.0.4", "prettier": "1.12.0" }, 回答1: The problem for me was I ran "

How to lint for Typescript compilation issues?

风流意气都作罢 提交于 2019-11-30 09:12:32
问题 Take the following Typescript arrow function: /** * Returns a probably unique component name. * * @param baseName a suggested name to make unique. * @returns a probably unique name. */ export const getUniqueComponentName = ( baseName ): string => { return baseName + Math.round(Math.random() * 10000000) } When Typescript is configured in tsconfig.json as such: "noImplicitAny": true, This correctly results in a compilation error: [ts] Parameter 'baseName' implicitly has an 'any' type. Visual

How to lint for Typescript compilation issues?

吃可爱长大的小学妹 提交于 2019-11-29 13:37:24
Take the following Typescript arrow function: /** * Returns a probably unique component name. * * @param baseName a suggested name to make unique. * @returns a probably unique name. */ export const getUniqueComponentName = ( baseName ): string => { return baseName + Math.round(Math.random() * 10000000) } When Typescript is configured in tsconfig.json as such: "noImplicitAny": true, This correctly results in a compilation error: [ts] Parameter 'baseName' implicitly has an 'any' type. Visual Studio Code is also smart enough to inform you about this issue during development. My goal is to create

Husky giving error SyntaxError: Use of const in strict mode

只谈情不闲聊 提交于 2019-11-29 11:56:01
I am using Husky with Lint-staged and Stylelint "scripts": { "precommit": "lint-staged", }, "lint-staged": { "*.scss": ["stylelint --syntax scss" ] }, OS - Latest OSX Node - 6.10.0 NPM - 3.10.00 I'm getting this error on git commit > husky - npm run -s precommit /Users/jitendravyas/app/node_modules/lint-staged/src/index.js:6 const path = require('path') ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load

Husky giving error SyntaxError: Use of const in strict mode

假装没事ソ 提交于 2019-11-28 05:13:14
问题 I am using Husky with Lint-staged and Stylelint "scripts": { "precommit": "lint-staged", }, "lint-staged": { "*.scss": ["stylelint --syntax scss" ] }, OS - Latest OSX Node - 6.10.0 NPM - 3.10.00 I'm getting this error on git commit > husky - npm run -s precommit /Users/jitendravyas/app/node_modules/lint-staged/src/index.js:6 const path = require('path') ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object