Skip to content

Commit

Permalink
Fix the default value for the filename-case rule
Browse files Browse the repository at this point in the history
The default was not what was documented. It was documented as `kebabCase`, but the default in the code was `camelCase`.
  • Loading branch information
sindresorhus committed Feb 7, 2019
1 parent c493115 commit 139ac16
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
14 changes: 2 additions & 12 deletions index.js
Expand Up @@ -17,19 +17,9 @@ module.exports = {
'unicorn'
],
rules: {
'unicorn/catch-error-name': [
'error',
{
name: 'error'
}
],
'unicorn/catch-error-name': 'error',
'unicorn/explicit-length-check': 'error',
'unicorn/filename-case': [
'error',
{
case: 'kebabCase'
}
],
'unicorn/filename-case': 'error',
'unicorn/no-abusive-eslint-disable': 'error',
'unicorn/no-process-exit': 'error',
'unicorn/throw-new-error': 'error',
Expand Down
14 changes: 2 additions & 12 deletions readme.md
Expand Up @@ -35,19 +35,9 @@ Configure it in `package.json`.
"unicorn"
],
"rules": {
"unicorn/catch-error-name": [
"error",
{
"name": "error"
}
],
"unicorn/catch-error-name": "error",
"unicorn/explicit-length-check": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
],
"unicorn/filename-case": "error",
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-process-exit": "error",
"unicorn/throw-new-error": "error",
Expand Down
2 changes: 1 addition & 1 deletion rules/filename-case.js
Expand Up @@ -70,7 +70,7 @@ function splitFilename(filename) {
const create = context => {
const options = context.options[0] || {};

const chosenCase = cases[options.case || 'camelCase'];
const chosenCase = cases[options.case || 'kebabCase'];
const filenameWithExt = context.getFilename();

if (filenameWithExt === '<text>') {
Expand Down
2 changes: 1 addition & 1 deletion test/filename-case.js
Expand Up @@ -83,7 +83,7 @@ ruleTester.run('filename-case', rule, {
testCase(
'src/foo/foo_bar.js',
undefined,
'Filename is not in camel case. Rename it to `fooBar.js`.'
'Filename is not in kebab case. Rename it to `foo-bar.js`.'
),
testCase(
'src/foo/foo_bar.js',
Expand Down

0 comments on commit 139ac16

Please sign in to comment.