@joondeveloper/eslint-config 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +20 -19
  2. package/node.js +46 -12
  3. package/package.json +2 -2
  4. package/next.js +0 -56
package/README.md CHANGED
@@ -18,23 +18,7 @@ Este pacote fornece uma configuração abrangente de ESLint com:
18
18
 
19
19
  ## 🚀 Instalação
20
20
 
21
- ### React (com Next.js)
22
-
23
- Instale o pacote e o ESLint como dependências de desenvolvimento:
24
-
25
- ```bash
26
- npm i -D eslint @joondeveloper/eslint-config
27
- ```
28
-
29
- Crie ou atualize seu `.eslintrc.json`:
30
-
31
- ```json
32
- {
33
- "extends": ["@joondeveloper/eslint-config/next"]
34
- }
35
- ```
36
-
37
- ### React (sem Next.js)
21
+ ### React
38
22
 
39
23
  Instale o pacote e o ESLint como dependências de desenvolvimento:
40
24
 
@@ -81,10 +65,27 @@ Você pode substituir essas configurações criando um arquivo `.prettierrc` na
81
65
 
82
66
  ## 🔧 Configurações Disponíveis
83
67
 
84
- - `@joondeveloper/eslint-config/next` - Para projetos Next.js
85
- - `@joondeveloper/eslint-config/react` - Para projetos React (sem Next.js)
68
+ - `@joondeveloper/eslint-config/react` - Para projetos React
86
69
  - `@joondeveloper/eslint-config/node` - Para projetos Node.js
87
70
 
71
+ ## 🛠️ Scripts Recomendados
72
+
73
+ Adicione estes scripts ao seu `package.json` para facilitar o uso do ESLint:
74
+
75
+ ```json
76
+ {
77
+ "scripts": {
78
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
79
+ "lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix"
80
+ }
81
+ }
82
+ ```
83
+
84
+ **Uso:**
85
+
86
+ - `npm run lint` - Verifica erros de linting
87
+ - `npm run lint:fix` - Corrige automaticamente problemas de formatação
88
+
88
89
  ## 📜 Licença
89
90
 
90
91
  MIT © João M J Braga
package/node.js CHANGED
@@ -1,31 +1,65 @@
1
1
  module.exports = {
2
2
  env: {
3
+ browser: true,
3
4
  es2021: true,
4
- node: true,
5
+ jest: true,
5
6
  },
6
- extends: ['standard', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
7
+ extends: [
8
+ 'plugin:react/recommended',
9
+ 'plugin:react-hooks/recommended',
10
+ 'standard',
11
+ 'plugin:@typescript-eslint/recommended',
12
+ 'plugin:prettier/recommended',
13
+ ],
7
14
  parser: '@typescript-eslint/parser',
8
15
  parserOptions: {
16
+ ecmaFeatures: {
17
+ jsx: true
18
+ },
9
19
  ecmaVersion: 'latest',
10
- sourceType: 'module',
20
+ sourceType: 'module'
11
21
  },
12
- plugins: ['@typescript-eslint'],
22
+ plugins: [
23
+ 'react',
24
+ 'jsx-a11y',
25
+ '@typescript-eslint'
26
+ ],
13
27
  rules: {
14
- 'prettier/prettier': [
15
- 'error',
28
+ "react/self-closing-comp": "error",
29
+ 'prettier/prettier': ["error", {
30
+ 'printWidth': 80,
31
+ 'tabWidth': 2,
32
+ 'singleQuote': true,
33
+ 'trailingComma': 'all',
34
+ 'arrowParens': 'always',
35
+ 'semi': false,
36
+ 'endOfLine': 'auto',
37
+ }],
38
+ 'react/react-in-jsx-scope': 'off',
39
+ 'react/prop-types': 'off',
40
+ 'jsx-a11y/alt-text': [
41
+ 'warn',
16
42
  {
17
- printWidth: 80,
18
- tabWidth: 2,
19
- singleQuote: true,
20
- trailingComma: 'all',
21
- arrowParens: 'always',
22
- semi: false,
43
+ elements: ['img'],
44
+ img: ['Image'],
23
45
  },
24
46
  ],
47
+ 'jsx-a11y/aria-props': 'warn',
48
+ 'jsx-a11y/aria-proptypes': 'warn',
49
+ 'jsx-a11y/aria-unsupported-elements': 'warn',
50
+ 'jsx-a11y/role-has-required-aria-props': 'warn',
51
+ 'jsx-a11y/role-supports-aria-props': 'warn',
52
+ 'react/no-unknown-property': 'error',
25
53
  },
26
54
  settings: {
55
+ react: {
56
+ version: 'detect',
57
+ },
27
58
  'import/parsers': {
28
59
  [require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
29
60
  },
30
61
  },
62
+ ignorePatterns: [
63
+ 'node_modules'
64
+ ]
31
65
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@joondeveloper/eslint-config",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
- "description": "Configuração do ESLint",
5
+ "description": "Configurações de ESLint para React e Node.js.",
6
6
  "main": "index.js",
7
7
  "license": "MIT",
8
8
  "repository": {
package/next.js DELETED
@@ -1,56 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- jest: true,
6
- },
7
- extends: [
8
- 'standard',
9
- 'plugin:@typescript-eslint/recommended',
10
- 'plugin:prettier/recommended',
11
- ],
12
- parser: '@typescript-eslint/parser',
13
- parserOptions: {
14
- ecmaFeatures: {
15
- jsx: true
16
- },
17
- ecmaVersion: 'latest',
18
- sourceType: 'module'
19
- },
20
- plugins: [
21
- 'jsx-a11y',
22
- '@typescript-eslint'
23
- ],
24
- rules: {
25
- 'prettier/prettier': ["error", {
26
- 'printWidth': 80,
27
- 'tabWidth': 2,
28
- 'singleQuote': true,
29
- 'trailingComma': 'all',
30
- 'arrowParens': 'always',
31
- 'semi': false,
32
- 'endOfLine': 'auto',
33
- }],
34
- 'jsx-a11y/alt-text': [
35
- 'warn',
36
- {
37
- elements: ['img'],
38
- img: ['Image'],
39
- },
40
- ],
41
- 'jsx-a11y/aria-props': 'warn',
42
- 'jsx-a11y/aria-proptypes': 'warn',
43
- 'jsx-a11y/aria-unsupported-elements': 'warn',
44
- 'jsx-a11y/role-has-required-aria-props': 'warn',
45
- 'jsx-a11y/role-supports-aria-props': 'warn',
46
- 'react/no-unknown-property': 'error',
47
- },
48
- settings: {
49
- react: {
50
- version: 'detect',
51
- },
52
- 'import/parsers': {
53
- [require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
54
- },
55
- }
56
- }