Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
eslint-plugin-require-path-exists
Advanced tools
This repository will give access to new rules for the ESLint tool. You should use it only if you are developing a CommonJS application. It checks for require() function usage (or for import, if you're using ES6 syntax).
require()
and ES6 import
syntaxlinter-eslint
packageInstall eslint-plugin-require-path-exists
as a dev-dependency:
npm install --save-dev eslint-plugin-require-path-exists
Enable the plugin by adding it to the plugins
and start from default (recommended) configuration in extends
in .eslintrc
:
{
"extends": [
"plugin:require-path-exists/recommended"
],
"plugins": [
"require-path-exists"
]
}
You can also configure these rules in your .eslintrc
. All rules defined in this plugin have to be prefixed by 'require-path-exists/'
{
"plugins": [
"require-path-exists"
],
"rules": {
"require-path-exists/notEmpty": 2,
"require-path-exists/tooManyArguments": 2,
"require-path-exists/exists": [ 2, {
"extensions": [
"",
".jsx",
".es.js",
".jsx",
".json5",
".es",
".es6",
".coffee"
],
"webpackConfigPath": "webpack.config.js"
}]
}
] } ```
Name | Description | Default Configuration |
---|---|---|
require-path-exists/notEmpty | You should not call require() without arguments or with empty argument | 2 |
require-path-exists/tooManyArguments | You should pass only one argument to require() function | 2 |
require-path-exists/exists | You should only pass existing paths to require() | [ 2, { "extensions": [ "", ".js", ".json", ".node" ], "webpackConfigPath": null }] |
MIT
FAQs
Checks all require path's to exist as files
The npm package eslint-plugin-require-path-exists receives a total of 6,049 weekly downloads. As such, eslint-plugin-require-path-exists popularity was classified as popular.
We found that eslint-plugin-require-path-exists demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.