@eduzz/eslint-config
Advanced tools
Comparing version 2.0.0-beta.7 to 2.0.0
@@ -11,3 +11,3 @@ module.exports = { | ||
arrowParens: 'avoid', | ||
endOfLine: 'lf', | ||
endOfLine: 'auto', | ||
printWidth: 120, | ||
@@ -14,0 +14,0 @@ semi: true, |
@@ -45,3 +45,9 @@ const pluginImport = require('eslint-plugin-import'); | ||
], | ||
'linebreak-style': ['error', 'unix'], | ||
'no-restricted-syntax': [ | ||
'error', | ||
{ | ||
selector: 'VariableDeclarator > Identifier[name=/^process/i]', | ||
message: 'process is a reserved name for NodeJS Enviroment' | ||
} | ||
], | ||
'max-lines': ['error', 300], | ||
@@ -48,0 +54,0 @@ 'max-len': ['off'], |
@@ -1,2 +0,2 @@ | ||
const children = require('child_process'); | ||
const childProcess = require('child_process'); | ||
const fs = require('node:fs'); | ||
@@ -6,5 +6,5 @@ | ||
module.exports = function gitignore(extra = []) { | ||
const files = children | ||
.execSync("git ls-files '*.gitignore'") | ||
module.exports = function gitignore(...extra) { | ||
const files = childProcess | ||
.execSync('git ls-files *.gitignore') | ||
.toString() | ||
@@ -27,2 +27,3 @@ .split('\n') | ||
const globs = parsed.globs(); | ||
console.log(JSON.stringify(globs, null, 2)); | ||
@@ -29,0 +30,0 @@ for (const glob of globs) { |
{ | ||
"name": "@eduzz/eslint-config", | ||
"private": false, | ||
"version": "2.0.0-beta.7", | ||
"version": "2.0.0", | ||
"keywords": [ | ||
@@ -28,19 +28,18 @@ "eduzz", | ||
"@eduzz/eslint-config": "^2.0.0-beta.0", | ||
"@types/eslint": "^8.56.7", | ||
"eslint": "^8", | ||
"@types/eslint": "^8.56.10", | ||
"eslint": "^9", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-eslint-plugin": "^5.5.0", | ||
"eslint-plugin-eslint-plugin": "^6.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.1", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-native": "^4.1.0", | ||
"eslint-plugin-unused-imports": "^3.1.0", | ||
"eslint-plugin-react": "^7.34.2", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-unused-imports": "^4.0.0", | ||
"parse-gitignore": "^2.0.0", | ||
"prettier": "^3.2.5", | ||
"prettier-plugin-tailwindcss": "^0.5.13", | ||
"typescript-eslint": "^7.5.0" | ||
"prettier": "^3.3.0", | ||
"prettier-plugin-tailwindcss": "^0.6.1", | ||
"typescript-eslint": "^7.11.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.4.4" | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -47,0 +46,0 @@ "peerDependencies": {}, |
const { configs } = require('./react'); | ||
const pluginReactNative = require('eslint-plugin-react-native'); | ||
@@ -8,16 +7,3 @@ const ignores = require('./ignores'); | ||
ignores, | ||
/** @type import('eslint').Linter.FlatConfig[] */ | ||
configs: [ | ||
...configs, | ||
{ | ||
name: '@eduzz/eslint-config-react-native', | ||
plugins: { | ||
'react-native': pluginReactNative | ||
}, | ||
rules: { | ||
'react-native/no-inline-styles': ['warn'], | ||
'react-native/no-unused-styles': ['error'] | ||
} | ||
} | ||
] | ||
configs | ||
}; |
@@ -5,46 +5,19 @@ # ESLint Config | ||
## Migração | ||
Se está migrando do `@eduzz/eslint-config-houston` altere as configurações do `.eslintrc [extends]` para: | ||
* `@eduzz/eslint-config-houston` >> `@eduzz/eslint-config/react` | ||
* `@eduzz/eslint-config-houston/native` >> `@eduzz/eslint-config/react-native` | ||
* `@eduzz/eslint-config-houston/node` >> `@eduzz/eslint-config` | ||
## Instalação | ||
Para configurar no padrão da Eduzz, primerio você deve adicionar as dependências, pois o eslint exige que plugins devem, | ||
ser adicionados no projeto principal | ||
### Javascript / Typescript / Node | ||
```sh | ||
yarn add --dev @eduzz/eslint-config 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 prettier | ||
yarn add --dev @eduzz/eslint-config | ||
``` | ||
1. `eslint.config.js` | ||
```js | ||
// .eslintrc | ||
{ | ||
"extends": ["@eduzz/eslint-config"] | ||
} | ||
const { ignores, configs } = require('@eduzz/eslint-config'); // Javascript / Typescript / Node | ||
const { ignores, configs } = require('@eduzz/eslint-config/react'); // React | ||
const { ignores, configs } = require('@eduzz/eslint-config/react-native'); // React Native | ||
// .prettierrc.js | ||
module.exports = { | ||
...require('@eduzz/eslint-config/.prettierrc') | ||
}; | ||
/** @type import('eslint').Linter.FlatConfig[] */ | ||
module.exports = [...configs, { ignores: ignores() }]; | ||
``` | ||
### React | ||
```sh | ||
yarn add --dev @eduzz/eslint-config 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 prettier | ||
``` | ||
2. `.prettierrc.js` | ||
```js | ||
// .eslintrc | ||
{ | ||
"extends": ["@eduzz/eslint-config/react"] | ||
} | ||
// .prettierrc.js | ||
module.exports = { | ||
@@ -55,22 +28,13 @@ ...require('@eduzz/eslint-config/.prettierrc') | ||
### React Native | ||
## Configurações Extras | ||
```sh | ||
yarn add --dev @eduzz/eslint-config 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 prettier | ||
``` | ||
### Ignore | ||
Por padrão todos os arquivos do `.gitignore` já são removidos, caso queira adicionar mais: | ||
```js | ||
// .eslintrc | ||
{ | ||
"extends": ["@eduzz/eslint-config/react-native"] | ||
} | ||
// .prettierrc.js | ||
module.exports = { | ||
...require('@eduzz/eslint-config/.prettierrc') | ||
}; | ||
/** @type import('eslint').Linter.FlatConfig[] */ | ||
module.exports = [...configs, { ignores: ignores('**/ignore/**.js', 'ignore.js') }]; | ||
``` | ||
## Configurações Extras | ||
### VSCode | ||
@@ -77,0 +41,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14
0
11094
243
59
+ Added@eslint/config-array@0.18.0(transitive)
+ Added@eslint/eslintrc@3.1.0(transitive)
+ Added@eslint/js@9.10.0(transitive)
+ Added@eslint/object-schema@2.1.4(transitive)
+ Added@eslint/plugin-kit@0.1.0(transitive)
+ Added@humanwhocodes/retry@0.3.0(transitive)
+ Addedeslint@9.10.0(transitive)
+ Addedeslint-plugin-eslint-plugin@6.2.0(transitive)
+ Addedeslint-plugin-unused-imports@4.1.3(transitive)
+ Addedeslint-scope@8.0.2(transitive)
+ Addedeslint-visitor-keys@4.0.0(transitive)
+ Addedespree@10.1.0(transitive)
+ Addedfile-entry-cache@8.0.0(transitive)
+ Addedflat-cache@4.0.1(transitive)
+ Addedglobals@14.0.0(transitive)
+ Addedprettier-plugin-tailwindcss@0.6.6(transitive)
- Removedeslint-plugin-react-native@^4.1.0
- Removedeslint-plugin-eslint-plugin@5.5.1(transitive)
- Removedeslint-plugin-react-native@4.1.0(transitive)
- Removedeslint-plugin-react-native-globals@0.1.2(transitive)
- Removedeslint-plugin-unused-imports@3.2.0(transitive)
- Removedeslint-rule-composer@0.3.0(transitive)
- Removedeslint-utils@3.0.0(transitive)
- Removedeslint-visitor-keys@2.1.0(transitive)
- Removedprettier-plugin-tailwindcss@0.5.14(transitive)
Updated@types/eslint@^8.56.10
Updatedeslint@^9
Updatedeslint-plugin-react@^7.34.2
Updatedprettier@^3.3.0
Updatedtypescript-eslint@^7.11.0