Skip to content

Instantly share code, notes, and snippets.

@bradzacher
Last active January 9, 2019 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradzacher/07d98abce83ed5a4094ccbfacca8b82f to your computer and use it in GitHub Desktop.
Save bradzacher/07d98abce83ed5a4094ccbfacca8b82f to your computer and use it in GitHub Desktop.
prettier-eslint eslint-plugin-typescript@1.0.0 bug
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,
},
],
},
}
{
"arrowParens": "avoid",
"bracketSpacing": true,
"parser": "typescript",
"jsxBracketSameLine": true,
"proseWrap": "preserve",
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}

REPRO STEPS

  1. yarn install
  2. open test.ts
  3. yarn lint to run eslint, note no errors
  4. yarn format to run prettier-eslint, note the colon placement
  5. yarn lint, note the eslint error
  6. yarn fix to run eslint --fix, note the colon placement
  7. yarn lint, note the error has gone
{
"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"
}
}
const foo : string = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment