Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
eslint-plugin-evelyn
Advanced tools
ESLint plugin for my projects with my preferred code style and bugfixes
These are my configs and code related to maintaining ESLint scripts.
My code style is very opinionated, so I only use this package on my projects. However, others are welcome to use, copy, or fork this project.
Save this project to your dev dependencies. If you are using an version on npm older than v7.0.0, you will have to install peer dependencies manually.
npm install --save-dev eslint-plugin-evelyn
npm may warn about any missing peer dependencies when installing this plugin.
npm WARN eslint-plugin-evelyn@x.x.x requires a peer of eslint-plugin-xxxxx@^x.x.x but none is installed. You must install peer dependencies yourself.
If you are using and loading a config that requires one of the mentioned dependencies, add the plugin as a dev dependency that satisfies the specified version range. Otherwise, you can safely ignore these messages.
ESLint always resolves and loads plugins when the configs are extended in the top-level config, but only resolves plugins in an override once a file matches its glob pattern.
Include as many configs as you'd like to use in your config. Extend them in the order that they should be applied, in order of importance, lowest to highest.
.eslintrc
{
"plugins": [
"evelyn"
],
"extends": [
"plugin:evelyn/default",
"plugin:evelyn/node"
]
}
Requires eslint >=6.0.0
.
.eslintrc
{
"plugins": [
"evelyn"
],
"extends": [
"plugin:evelyn/default"
],
"overrides": [
{
"files": [
"src/**/*.js"
],
"extends": [
"plugin:evelyn/node"
]
}
]
}
.eslintrc.js
module.exports = {
"plugins": [
"@evelyn",
],
"extends": [
"plugin:@evelyn/default",
"plugin:@evelyn/node",
"plugin:@evelyn/react",
"plugin:@evelyn/typescript",
],
"ignorePatterns": [
"build",
"coverage",
],
"overrides": [
{
"files": [
"**/*.test.{ts,tsx}",
"**/__tests__/**/*.{ts,tsx}",
],
"extends": [
"plugin:@evelyn/jest",
"plugin:@evelyn/testing-library-react",
],
},
],
};
package.json
(snippet)
Make sure to remove any references to old ESLint plugins or configs and replace the lint script with eslint ./
.
{
"name": "my-app",
"...": "...",
"scripts": {
"...": "...",
"lint": "eslint ./"
}
}
# Install dependencies
npm install
# Symlink itself into node_modules for ESLint
# As of eslint-plugin-evelyn v3.0.0, this is done fully automatically
npm run link
# Run all tests!
npm run test
final-config-array.eslintrc.js tests to make sure all modules and configs load properly. Without this test, if a parser or plugin doesn't load and is never used to lint a file, ESLint won't report the error.
This plugin uses itself to lint so we must make sure the working copy of eslint-plugin-evelyn
is in node_modules
. Only ESLint should require it from there.
# Install dependencies
npm install
# Symlink itself into node_modules for ESLint
# As of eslint-plugin-evelyn v3.0.0, this is done fully automatically
npm run link
# Run lint!
npm run lint
npm run
or npx eslint
--debug
ESLint CLI flag for determining things like the modules that get loaded--print-config
ESLint CLI flag for a minimal computed configRun the default export from the save-config.js
file from inside the config file to output to monkey-patch ESLint. This works on this project as well as any package that has eslint-plugin-evelyn >=1.0.0
as a dependency.
.eslintrc.js
require("eslint-plugin-evelyn/lib/util/save-config")();
// The rest of your config file
// [...]
This saves the config array that is usually partially outputted to the console during execution with the --debug
flag.
$ npx eslint --debug
# [...]
eslint:cascading-config-array-factory Configuration was determined: ConfigArray [...]
record-changes.eslintrc.js saves the final config array to record-changes.json with paths removed.
The script is used to track the changes to the final array over time using the pre-commit git hook. This is helpful in reviewing pull requests.
See the peerDependencies
in package.json for recommended dependency version ranges.
Name | Peer Dependencies |
---|---|
babel | @babel/eslint-parser |
default | eslint-plugin-unicorn, eslint-plugin-import, eslint-plugin-regexp |
esm | eslint-plugin-unicorn, eslint-plugin-import |
jest | eslint-plugin-node, eslint-plugin-jest |
jsx | eslint-plugin-jsx-a11y |
mocha | eslint-plugin-node, eslint-plugin-mocha |
node | eslint-plugin-node |
react | eslint-plugin-react, eslint-plugin-jsx-a11y, eslint-plugin-react-hooks, eslint-plugin-import |
testing-library | eslint-plugin-testing-library |
testing-library-react | eslint-plugin-testing-library |
typescript | @typescript-eslint/eslint-plugin, @typescript-eslint/parser, typescript, eslint-plugin-import, eslint-import-resolver-typescript |
This plugin follows semantic versioning a-la-ESLint.
semi
would be a good example as not enforcing it could create the potential to break your codepeerDependencies
or the engines
Copyright Evelyn Hathaway, MIT License
v9.0.0
v8.1.0...v9.0.0
- 2023-05-31
198a7d9
91277eb
FAQs
ESLint plugin for my projects with my preferred code style and bugfixes
We found that eslint-plugin-evelyn 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.