現在reactで開発中のプロダクトにeslintのrulesの中に'import/order'をセットしたのですが相対パスの時は反映して絶対パスの時は反映されません、
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
こちらの公式ドキュメントのgithubにも対処法が乗っていなくて見当がつかないのですが対象方がありましたらご教授ただければ幸いです。
module.exports = { env: { browser: true, es6: true, }, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended', ], plugins: ['@typescript-eslint', 'import'], parser: '@typescript-eslint/parser', parserOptions: { sourceType: 'module', project: './tsconfig.json', }, root: true, rules: { 'import/order': [ 'error', { groups: ['builtin', 'external', 'internal'], pathGroups: [ { pattern: 'react', group: 'external', position: 'before', }, ], pathGroupsExcludedImportTypes: ['react'], alphabetize: { order: 'asc', caseInsensitive: true, }, }, ], 'prettier/prettier': [ 'error', { singleQuote: true, trailingComma: 'es5', }, ], }, }
こちらがeslint内のコードでございます。
実際に import しているソースを貼りましょう。
あなたの回答
tips
プレビュー