@joondeveloper/eslint-config 0.0.3

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 (5) hide show
  1. package/README.md +100 -0
  2. package/next.js +56 -0
  3. package/node.js +31 -0
  4. package/package.json +35 -0
  5. package/react.js +65 -0
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # @joondeveloper/eslint-config
2
+
3
+ > Configuração de ESLint
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@joondeveloper/eslint-config.svg)](https://www.npmjs.com/package/@joondeveloper/eslint-config)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## 📦 O que está incluído?
9
+
10
+ Este pacote fornece uma configuração abrangente de ESLint com:
11
+
12
+ - **Configuração base padrão** - Guia de estilo JavaScript Standard
13
+ - **Suporte a TypeScript** - Linting completo de TypeScript com `@typescript-eslint`
14
+ - **Plugin React** - Regras de linting específicas para React
15
+ - **Plugin React Hooks** - Aplica as Regras dos Hooks
16
+ - **Plugin JSX a11y** - Verificações de acessibilidade para elementos JSX
17
+ - **Integração com Prettier** - Formatação de código com Prettier
18
+
19
+ ## 🚀 Instalação
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)
38
+
39
+ Instale o pacote e o ESLint como dependências de desenvolvimento:
40
+
41
+ ```bash
42
+ npm i -D eslint @joondeveloper/eslint-config
43
+ ```
44
+
45
+ Crie ou atualize seu `.eslintrc.json`:
46
+
47
+ ```json
48
+ {
49
+ "extends": "@joondeveloper/eslint-config/react"
50
+ }
51
+ ```
52
+
53
+ ### Node.js
54
+
55
+ Instale o pacote e o ESLint como dependências de desenvolvimento:
56
+
57
+ ```bash
58
+ npm i -D eslint @joondeveloper/eslint-config
59
+ ```
60
+
61
+ Crie ou atualize seu `.eslintrc.json`:
62
+
63
+ ```json
64
+ {
65
+ "extends": "@joondeveloper/eslint-config/node"
66
+ }
67
+ ```
68
+
69
+ ## 📝 Configuração do Prettier
70
+
71
+ Esta configuração inclui definições opinativas do Prettier:
72
+
73
+ - **Largura de Impressão**: 80 caracteres
74
+ - **Largura da Tabulação**: 2 espaços
75
+ - **Aspas**: Aspas simples
76
+ - **Ponto e vírgula**: Desabilitado
77
+ - **Vírgulas Finais**: Todas
78
+ - **Parênteses em Arrow Functions**: Sempre
79
+
80
+ Você pode substituir essas configurações criando um arquivo `.prettierrc` na raiz do seu projeto.
81
+
82
+ ## 🔧 Configurações Disponíveis
83
+
84
+ - `@joondeveloper/eslint-config/next` - Para projetos Next.js
85
+ - `@joondeveloper/eslint-config/react` - Para projetos React (sem Next.js)
86
+ - `@joondeveloper/eslint-config/node` - Para projetos Node.js
87
+
88
+ ## 📜 Licença
89
+
90
+ MIT © João M J Braga
91
+
92
+ ## 🤝 Contribuindo
93
+
94
+ Contribuições, issues e solicitações de funcionalidades são bem-vindas!
95
+
96
+ ## 📧 Contato
97
+
98
+ João M J Braga - [@joaomjbraga](https://github.com/joondeveloper)
99
+
100
+ Link do Projeto: [https://github.com/joaomjbraga/eslint-config-joondeveloper](https://github.com/joaomjbraga/eslint-config-joondeveloper)
package/next.js ADDED
@@ -0,0 +1,56 @@
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
+ }
package/node.js ADDED
@@ -0,0 +1,31 @@
1
+ module.exports = {
2
+ env: {
3
+ es2021: true,
4
+ node: true,
5
+ },
6
+ extends: ['standard', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
7
+ parser: '@typescript-eslint/parser',
8
+ parserOptions: {
9
+ ecmaVersion: 'latest',
10
+ sourceType: 'module',
11
+ },
12
+ plugins: ['@typescript-eslint'],
13
+ rules: {
14
+ 'prettier/prettier': [
15
+ 'error',
16
+ {
17
+ printWidth: 80,
18
+ tabWidth: 2,
19
+ singleQuote: true,
20
+ trailingComma: 'all',
21
+ arrowParens: 'always',
22
+ semi: false,
23
+ },
24
+ ],
25
+ },
26
+ settings: {
27
+ 'import/parsers': {
28
+ [require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
29
+ },
30
+ },
31
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@joondeveloper/eslint-config",
3
+ "version": "0.0.3",
4
+ "private": false,
5
+ "description": "Configuração do ESLint",
6
+ "main": "index.js",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "url": "joaomjbraga/eslint-config-joondeveloper"
10
+ },
11
+ "peerDependencies": {
12
+ "eslint": "^8.0.0",
13
+ "typescript": ">=5"
14
+ },
15
+ "peerDependenciesMeta": {
16
+ "typescript": {
17
+ "optional": true
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
22
+ "@typescript-eslint/parser": "^6.21.0",
23
+ "eslint": "^8.56.0",
24
+ "eslint-config-prettier": "^9.1.0",
25
+ "eslint-config-standard": "^17.1.0",
26
+ "eslint-plugin-import": "^2.29.1",
27
+ "eslint-plugin-jsx-a11y": "^6.8.0",
28
+ "eslint-plugin-n": "^16.6.2",
29
+ "eslint-plugin-prettier": "^5.1.3",
30
+ "eslint-plugin-promise": "^6.1.1",
31
+ "eslint-plugin-react": "^7.33.2",
32
+ "eslint-plugin-react-hooks": "^4.6.0",
33
+ "prettier": "^3.2.5"
34
+ }
35
+ }
package/react.js ADDED
@@ -0,0 +1,65 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ jest: true,
6
+ },
7
+ extends: [
8
+ 'plugin:react/recommended',
9
+ 'plugin:react-hooks/recommended',
10
+ 'standard',
11
+ 'plugin:@typescript-eslint/recommended',
12
+ 'plugin:prettier/recommended',
13
+ ],
14
+ parser: '@typescript-eslint/parser',
15
+ parserOptions: {
16
+ ecmaFeatures: {
17
+ jsx: true
18
+ },
19
+ ecmaVersion: 'latest',
20
+ sourceType: 'module'
21
+ },
22
+ plugins: [
23
+ 'react',
24
+ 'jsx-a11y',
25
+ '@typescript-eslint'
26
+ ],
27
+ rules: {
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',
42
+ {
43
+ elements: ['img'],
44
+ img: ['Image'],
45
+ },
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',
53
+ },
54
+ settings: {
55
+ react: {
56
+ version: 'detect',
57
+ },
58
+ 'import/parsers': {
59
+ [require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
60
+ },
61
+ },
62
+ ignorePatterns: [
63
+ 'node_modules'
64
+ ]
65
+ }