Skip to content

Commit

Permalink
Add support for scoped configs
Browse files Browse the repository at this point in the history
  • Loading branch information
tjrgg committed May 16, 2020
1 parent ca21492 commit 4386702
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/options-manager.js
Expand Up @@ -345,6 +345,10 @@ const buildExtendsConfig = options => config => {
return name;
}

if (name.startsWith('@')) {
return name;
}

if (!name.includes('eslint-config-')) {
name = `eslint-config-${name}`;
}
Expand Down
10 changes: 7 additions & 3 deletions test/options-manager.js
Expand Up @@ -423,13 +423,17 @@ test('buildConfig: extends', t => {
const config = manager.buildConfig({extends: [
'plugin:foo/bar',
'eslint-config-foo-bar',
'foo-bar-two'
'foo-bar-two',
'@foobar',
'@foobar/eslint-config'
]});

t.deepEqual(config.baseConfig.extends.slice(-3), [
t.deepEqual(config.baseConfig.extends.slice(-5), [
'plugin:foo/bar',
'cwd/eslint-config-foo-bar',
'cwd/eslint-config-foo-bar-two'
'cwd/eslint-config-foo-bar-two',
'@foobar',
'@foobar/eslint-config'
]);
});

Expand Down

0 comments on commit 4386702

Please sign in to comment.