Skip to content

Commit

Permalink
add ESLint support for TS import type syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
benyasin authored and benyasin committed Jun 29, 2021
1 parent 62649e4 commit 1e06250
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ For a complete usage example, please refer to this [react-snowpack](https://gith

# Changelog

1.0.10
1.0.11

* add ESLint support for Typescript 3.8+ `import type` syntax

Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ module.exports = {

# 更新日志

1.0.10
1.0.11

* 添加 eslint 对 typescript 3.8+ 新语法 `import type`的支持

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "code-specification-unid",
"version": "1.0.10",
"version": "1.0.11",
"description": "A collection of configuration files containing prettier, eslint, stylelint, husky, lint-staged, commitlint",
"keywords": [
"eslint",
Expand Down Expand Up @@ -32,7 +32,7 @@
"prettier": "prettier -c --write \"**/*\""
},
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-decorators": "^7.13.5",
Expand Down
4 changes: 2 additions & 2 deletions src/eslintReact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ module.exports = {
ignorePatterns: ['.*.js'],
extends: ['plugin:react/recommended']
.concat(
isTsProject ? ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'] : [],
isTsProject ? ['plugin:@typescript-eslint/recommended'] : [],
)
.concat(['prettier', 'prettier/react', 'plugin:prettier/recommended']),
.concat(['prettier','plugin:prettier/recommended']),
parser: isTsProject ? '@typescript-eslint/parser' : '@babel/eslint-parser',
plugins: ['eslint-comments', 'react', 'jest', 'unicorn', 'react-hooks', 'filename'],
env: {
Expand Down
2 changes: 1 addition & 1 deletion src/eslintSvelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (isTsProject) {

module.exports = {
ignorePatterns: ['.*.js'],
extends: (isTsProject ? ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'] : ['eslint:recommended']),
extends: (isTsProject ? ['plugin:@typescript-eslint/recommended'] : ['eslint:recommended']),
parser: isTsProject ? '@typescript-eslint/parser' : '@babel/eslint-parser',
plugins: ['eslint-comments', 'jest', 'unicorn', 'filename', 'svelte3'],
overrides: [
Expand Down
3 changes: 1 addition & 2 deletions src/eslintVue2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ module.exports = {
'plugin:vue/essential',
'plugin:vue/strongly-recommended',
'plugin:vue/recommended',
'prettier/vue',
]
.concat(
isTsProject ? ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'] : [],
isTsProject ? ['plugin:@typescript-eslint/recommended'] : [],
)
.concat(['plugin:prettier/recommended']),
parser: 'vue-eslint-parser',
Expand Down
3 changes: 1 addition & 2 deletions src/eslintVue3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ module.exports = {
'plugin:vue/vue3-essential',
'plugin:vue/vue3-strongly-recommended',
'plugin:vue/vue3-recommended',
'prettier/vue',
]
.concat(
isTsProject ? ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'] : [],
isTsProject ? ['plugin:@typescript-eslint/recommended'] : [],
)
.concat(['plugin:prettier/recommended']),
parser: 'vue-eslint-parser',
Expand Down
227 changes: 226 additions & 1 deletion yarn.lock

Large diffs are not rendered by default.

0 comments on commit 1e06250

Please sign in to comment.