Skip to content

Commit 6a05691

Browse files
authored
Add support for scoped shareable configs (#480)
1 parent ca21492 commit 6a05691

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/options-manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ const buildExtendsConfig = options => config => {
345345
return name;
346346
}
347347

348+
if (name.startsWith('@')) {
349+
return name;
350+
}
351+
348352
if (!name.includes('eslint-config-')) {
349353
name = `eslint-config-${name}`;
350354
}

test/options-manager.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,17 @@ test('buildConfig: extends', t => {
423423
const config = manager.buildConfig({extends: [
424424
'plugin:foo/bar',
425425
'eslint-config-foo-bar',
426-
'foo-bar-two'
426+
'foo-bar-two',
427+
'@foobar',
428+
'@foobar/eslint-config'
427429
]});
428430

429-
t.deepEqual(config.baseConfig.extends.slice(-3), [
431+
t.deepEqual(config.baseConfig.extends.slice(-5), [
430432
'plugin:foo/bar',
431433
'cwd/eslint-config-foo-bar',
432-
'cwd/eslint-config-foo-bar-two'
434+
'cwd/eslint-config-foo-bar-two',
435+
'@foobar',
436+
'@foobar/eslint-config'
433437
]);
434438
});
435439

0 commit comments

Comments
 (0)