Skip to content

Commit

Permalink
feat(typescript)!: add consistent type import and export related rules
Browse files Browse the repository at this point in the history
resolves #55
  • Loading branch information
frantic1048 committed Nov 27, 2023
1 parent baeddd1 commit 4d07ffa
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,19 @@ module.exports = {
typedefs: false,
},
],

// https://github.com/RightCapitalHQ/frontend-style-guide/issues/55
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: true },
],
'@typescript-eslint/no-import-type-side-effects': 'error',
},
};
32 changes: 32 additions & 0 deletions specs/eslint/__snapshots__/config-snapshot.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,19 @@ exports[`resolved config matches snapshot typescript.ts 1`] = `
"@typescript-eslint/comma-spacing": [
"off",
],
"@typescript-eslint/consistent-type-exports": [
"error",
{
"fixMixedExportsWithInlineTypeSpecifier": true,
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports",
"prefer": "type-imports",
},
],
"@typescript-eslint/func-call-spacing": [
"off",
],
Expand Down Expand Up @@ -2285,6 +2298,9 @@ exports[`resolved config matches snapshot typescript.ts 1`] = `
"@typescript-eslint/no-implied-eval": [
"error",
],
"@typescript-eslint/no-import-type-side-effects": [
"error",
],
"@typescript-eslint/no-loss-of-precision": [
"error",
],
Expand Down Expand Up @@ -4549,6 +4565,19 @@ exports[`resolved config matches snapshot typescript-react.tsx 1`] = `
"@typescript-eslint/comma-spacing": [
"off",
],
"@typescript-eslint/consistent-type-exports": [
"error",
{
"fixMixedExportsWithInlineTypeSpecifier": true,
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports",
"prefer": "type-imports",
},
],
"@typescript-eslint/func-call-spacing": [
"off",
],
Expand Down Expand Up @@ -4619,6 +4648,9 @@ exports[`resolved config matches snapshot typescript-react.tsx 1`] = `
"@typescript-eslint/no-implied-eval": [
"error",
],
"@typescript-eslint/no-import-type-side-effects": [
"error",
],
"@typescript-eslint/no-loss-of-precision": [
"error",
],
Expand Down

0 comments on commit 4d07ffa

Please sign in to comment.