Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@eduzz/eslint-config-houston
Advanced tools
name: ESLint
Para configurar no padrão do Houston, primerio você deve adicionar as dependências, pois o eslint exige que plugins devem, ser adicionados no projeto principal:
yarn add --dev eslint @eduzz/eslint-config-houston eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-eslint-plugin eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-unused-imports eslint-plugin-sonarjs prettier
// .eslintrc
{
"extends": ["@eduzz/eslint-config-houston"]
}
// .prettierrc.js
module.exports = {
...require('@eduzz/eslint-config-houston/.prettierrc')
};
yarn add --dev eslint @eduzz/eslint-config-houston eslint eslint-plugin-react-native @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-eslint-plugin eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-unused-imports eslint-plugin-sonarjs prettier
// .eslintrc
{
"extends": ["@eduzz/eslint-config-houston/native"]
}
// .prettierrc.js
module.exports = {
...require('@eduzz/eslint-config-houston/.prettierrc')
};
yarn add --dev eslint @eduzz/eslint-config-houston eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-eslint-plugin eslint-plugin-import eslint-plugin-prettier eslint-plugin-unused-imports eslint-plugin-sonarjs prettier
// .eslintrc
{
"extends": ["@eduzz/eslint-config-houston/node"]
}
// .prettierrc.js
module.exports = {
...require('@eduzz/eslint-config-houston/.prettierrc')
};
Adicione a extensão do ESLint. SUGERIMOS DESISTALAR OU DESATIVAR A EXTENSÃO DO PRETTIER POIS O ESLINT QUE APLICARÁ O PRETTIER.
Crie/Adicione no .vscode/settings.json (não na suas configurações, pois assim ficará no projeto e o time já terá acesso):
{
//... suas configurações
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
"editor.formatOnType": false,
"editor.tabSize": 2
}
Para que o eslint verifique e aplica a regra correta do react-hooks/exhaustive-deps é preciso adicionar seus custom hooks nas regras do .eslintrc, para facilitar esse processo criamos um generator. Já adicionados todos os hooks do Houston, mas caso queria adicionar os do seu proejeto:
// .eslintrc.js <~precisa ser .js
const generator = require('@eduzz/eslint-config-houston/configs/generator');
module.exports = {
extends: ['@eduzz/eslint-config-houston'],
rules: {
'react-hooks/exhaustive-deps': generator.exhaustiveDeps('warn', ['useMyCustomHook'], true)
}
};
Método | Params |
---|---|
exhaustiveDeps | 1. 'warn' | 'error' 2. Array com seus hooks 3. boolean se deve ou não adicionar os hooks do @eduzz/houston-hooks |
⚠️ Vale ressaltar que os custom hooks devem seguir o padrão de que o segundo parametro seja a deps
Para utilizar a nova versão do React com jsx-runtime basta seguir o tutorial do blog, mas resumidamente é:
# Removendo Imports React não Utilizadas
npx react-codemod update-react-imports
tsconfig.json
{
//... suas configurações
"compilerOptions": {
"jsx": "react-jsx" //Troque esse configuração
}
}
.eslintrc
{
"extends": ["@eduzz/eslint-config-houston"],
"rules": {
//Adicione essas rules
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
}
FAQs
Eduzz Houston Eslint Config
The npm package @eduzz/eslint-config-houston receives a total of 131 weekly downloads. As such, @eduzz/eslint-config-houston popularity was classified as not popular.
We found that @eduzz/eslint-config-houston demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.