yarn install
- open
test.ts
yarn lint
to run eslint, note no errorsyarn format
to runprettier-eslint
, note the colon placementyarn lint
, note the eslint erroryarn fix
to runeslint --fix
, note the colon placementyarn lint
, note the error has gone
-
-
Save bradzacher/07d98abce83ed5a4094ccbfacca8b82f to your computer and use it in GitHub Desktop.
prettier-eslint [email protected] bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
commonjs: true, | |
es6: true, | |
}, | |
parser: 'eslint-plugin-typescript/parser', | |
parserOptions: { | |
ecmaFeatures: { | |
globalReturn: false, | |
}, | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
}, | |
plugins: ['typescript'], | |
rules: { | |
'typescript/type-annotation-spacing': [ | |
'error', | |
{ | |
before: true, | |
after: true, | |
}, | |
], | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"arrowParens": "avoid", | |
"bracketSpacing": true, | |
"parser": "typescript", | |
"jsxBracketSameLine": true, | |
"proseWrap": "preserve", | |
"semi": false, | |
"singleQuote": true, | |
"tabWidth": 4, | |
"trailingComma": "all", | |
"useTabs": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"eslint": "^5.12.0", | |
"eslint-plugin-typescript": "^1.0.0-rc.2", | |
"prettier-eslint-cli": "^4.7.1", | |
"typescript": "^3.2.2" | |
}, | |
"scripts": { | |
"lint": "eslint ./test.ts", | |
"fix": "eslint ./test.ts --fix", | |
"format": "prettier-eslint ./test.ts --write" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const foo : string = '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment