Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions config/plugins.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ module.exports = {
],
'import/first': 'error',

// Disabled as it doesn't work with TypeScript.
// This issue and some others: https://github.com/benmosher/eslint-plugin-import/issues/1341
// 'import/named': 'error',
// Enabled, but disabled on TypeScript (https://github.com/xojs/xo/issues/576)
'import/named': 'error',

'import/namespace': [
'error',
Expand Down
4 changes: 4 additions & 0 deletions lib/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ const buildXOConfig = options => config => {

// Does not work when the TS definition exports a default const.
config.baseConfig.rules['import/default'] = 'off';

// Disabled as it doesn't work with TypeScript.
// This issue and some others: https://github.com/benmosher/eslint-plugin-import/issues/1341
config.baseConfig.rules['import/named'] = 'off';
}

config.baseConfig.settings['import/resolver'] = gatherImportResolvers(options);
Expand Down
1 change: 1 addition & 0 deletions test/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ test('buildConfig: typescript', t => {
project: './tsconfig.json',
projectFolderIgnoreList: [/\/node_modules\/(?!.*\.cache\/xo-linter)/],
});
t.is(config.baseConfig.rules['import/named'], 'off');
});

test('buildConfig: typescript with parserOption', t => {
Expand Down