An ESLint plugin for auto js extension
Prerequisites: ESLint v9
.
npm install eslint eslint-plugin-auto-js-extension --save-dev
or
npm install eslint@8.57.0 eslint-plugin-auto-js-extension --save-dev
ESLint v9
uses a Flat config file format with filename eslint.config.*js
by default. For instructions on using a deprecated eslintrc-type config file from previous ESLint versions, please refer to the below instructions.
To set up a flat configuration, add a file eslint.config.mjs
to the root directory of your project and include the following instructions to import the available flat configurations using:
import eslintPluginAutoJsExtension from "eslint-plugin-auto-js-extension";
💼 Configurations enabled in.\
Name | Description | 💼 |
---|---|---|
auto-js-extension | Ensure all JavaScript files have a .js extension | 💼 |
// eslint.config.mjs
import eslintPluginAutoJsExtension from "eslint-plugin-auto-js-extension";
export default [
{
ignores: ["eslint.config.mjs"],
},
{
plugins: { eslintPluginAutoJsExtension },
rules: {
"eslintPluginAutoJsExtension/auto-js-extension": "error",
},
},
];
// .eslintrc.json
{
"plugins": ["auto-js-extension"],
"rules": {
"auto-js-extension/auto-js-extension": "error"
}
}