Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@econominhas/eslint-config
Advanced tools
In this package, you can find the Econominhas Style Guide. We try to keep a clean and consistent code style, with modern features and using best practices.
[![Style Guide: Econominhas](https://img.shields.io/badge/style%20guide-Econominhas-4B00FA?style=plastic)](https://github.com/econominhas/eslint-config)
[![Style Guide: Econominhas](https://img.shields.io/badge/style%20guide-Econominhas-4B00FA?style=flat)](https://github.com/econominhas/eslint-config)
[![Style Guide: Econominhas](https://img.shields.io/badge/style%20guide-Econominhas-4B00FA?style=square)](https://github.com/econominhas/eslint-config)
[![Style Guide: Econominhas](https://img.shields.io/badge/style%20guide-Econominhas-4B00FA?style=for-the-badge)](https://github.com/econominhas/eslint-config)
This config needs prettier and eslint to work, as it is only a config and not the real package.
pnpm add -D @econominhas/eslint-config eslint prettier
Obs: If you are using VSCode, you may need/want to do some extra steps.
1 - Create a .eslintrc.js
file in the root of your project
2 - Put the following content inside the file:
module.exports = {
root: true,
extends: "@econominhas",
};
3 - Restart VSCode, and it's done!
Alert: After any change at .eslintrc.js
file, you should restart VSCode to ensure that it's working properly. This is a limitation of ESLint/VSCode, not our config.
Alert: The common module must ALWAYS be extend, and must ALWAYS be the fist one.
This repository contains the best practices divided by libs, frameworks and tools. The currently existent modules are:
The common module is the default rules used by every javascript project. It doesn't contains any special config for frameworks, backend, frontend or npm package. You must import this module if you want to use any of the other modules of this package.
Create an .eslintrc.js
file in the root folder of your package and add this content to it:
module.exports = {
root: true,
extends: "@econominhas",
};
Specific configs to projects that uses Jest.
Create an .eslintrc.js
file in the root folder of your package and add this content to it:
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
module.exports = {
root: true,
extends: [
"@econominhas", // The common module always should be extended!
"@econominhas/eslint-config/jest",
],
settings: {
jest: {
version: require("jest/package.json").version,
},
},
};
Specific configs for typescript projects.
Create an .eslintrc.js
file in the root folder of your package and add this content to it:
module.exports = {
root: true,
extends: [
"@econominhas", // The common module always should be extended!
"@econominhas/eslint-config/typescript",
],
};
tsconfig
for lintingBy default, this module uses tsconfig.json
file for configuring the typescript for the project, but you can use another file specifically for linting.
To use another file, simply add this to your .eslintrc.js
file:
/// .eslintrc.js
module.exports = {
// ...
parserOptions: {
project: "tsconfig.lint.json", // <<< Name of the tsconfig file here (Must be in the root folder of the project)
},
// ...
};
You can safely combine some modules, like this:
module.exports = {
root: true,
extends: [
"@econominhas", // The common module always should be extended!
"@econominhas/eslint-config/typescript",
"@econominhas/eslint-config/jest",
],
};
dbaeumer.vscode-eslint
and install itObs: You need to have the ESLint extension installed.
Add this to the project's .vscode/settings.json
file:
{
// Make ESLint fix all the things that he can on save (like prettier formatting)
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
// Remove formatter to avoid conflicts
"[javascript]": {
"editor.defaultFormatter": null
},
"[typescript]": {
"editor.defaultFormatter": null
},
"[javascriptreact]": {
"editor.defaultFormatter": null
},
"[typescriptreact]": {
"editor.defaultFormatter": null
}
}
FAQs
Econominhas Style Guide
The npm package @econominhas/eslint-config receives a total of 3 weekly downloads. As such, @econominhas/eslint-config popularity was classified as not popular.
We found that @econominhas/eslint-config demonstrated a healthy version release cadence and project activity because the last version was released less than 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.