dukeluo / eslint-plugin-check-file

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.

Home Page:https://www.npmjs.com/package/eslint-plugin-check-file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'check-file/folder-naming-convention' doesn't work with Angular naming convention

adrian-potepa opened this issue · comments

Hi!

I notice issue with 'check-file/folder-naming-convention' (v1.2.0).

With this settings:

 rules: {
    'check-file/folder-naming-convention': [
      'error',
      {
        'src/**': 'KEBAB_CASE',
      },
    ],
  },

I got errors on folders with correct kebab-case name:

Users/adrian/Workspace/my-project/src/app/components/announcement/modal/modal.component.ts
  9:5  error  The folder "modal.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

/Users/adrian/Workspace/my-project/src/app/components/status-dot/status-dot.component.ts
  0:1  error  The folder "status-dot.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

/Users/adrian/Workspace/my-project/src/app/page/authorized-area/account/activities/activities.component.ts
  16:5  error  The folder "activities.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

/Users/adrian/Workspace/my-project/src/app/page/authorized-area/export/download-history/download-history.component.ts
  18:5  error  The folder "download-history.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

/Users/adrian/Workspace/my-project/src/app/page/authorized-area/export/last-update/last-update.component.ts
  16:5  error  The folder "last-update.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

/Users/adrian/Workspace/my-project/src/app/page/authorized-area/export/list/item/item.component.ts
  21:5  error  The folder "item.component.ts" does not match the "KEBAB_CASE" style  check-file/folder-naming-convention

I used also regex +([a-z0-9])*(-+([a-z0-9])) but still the same result.

commented

do your eslint is used with some processors?

@dukeluo it uses several includig in angular-eslint package.

commented

@adrian-potepa Version 1.2.1 fixes the issue of getting the wrong folder when eslint is used with processors, you can try it now.

It works! Thanks @dukeluo :)

Hi @dukeluo ! We have the same issue, but now only on device with Windows.

On macOs and Ubuntu rule works as expect 🤔

image

commented

@adrian-potepa thanks for reporting, there are some compatibility issues with Windows, it has been reported on this issue #5 . I am currently working on this issue, and I will release a new version soon. Please stay tuned!

commented

@adrian-potepa Version 1.2.2 is released, you can try it now.

@dukeluo it works! Thanks 💪