8.0.0 • Published 5 years ago

eslint-plugin-typescript-filenames v8.0.0

Weekly downloads
251
License
-
Repository
-
Last release
5 years ago

eslint-plugin-typescript-filenames

Adds eslint rules to ensure consistent filenames for your javascript files.

Please note: This plugin will only lint the filenames of the .js, .jsx files you are linting with eslint. It will ignore other files that are not linted with eslint.

Enabling the plugin

This plugin requires a version of eslint>=5.x to be installed as a peer dependency.

Modify your .eslintrc file to load the plugin and enable the rules you want to use.

{
  "plugins": ["typescript-filenames"],
  "rules": {
    "typescript-filenames/no-js-extension": 2,
    "typescript-filenames/no-jsx-extension": 2
  }
}

Rules

Don't allow .js files (no-js-extensions)

When enabling this rule, the plugin will throw an error advising you to use .ts.

Don't allow .jsx files (no-jsx-extensions)

When enabling this rule, the plugin will throw an error advising you to use .tsx.