@ivanmaxlogiudice/eslint-config 0.0.2

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/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/index.js +184 -0
  4. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Iván Lo Giudice
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # ESLint Config
2
+
3
+ [![npm (scoped with tag)](https://flat.badgen.net/npm/v/@ivanmaxlogiudice/eslint-config)](https://npmjs.com/package/@ivanmaxlogiudice/eslint-config)
4
+ [![npm](https://flat.badgen.net/npm/dt/@ivanmaxlogiudice/eslint-config)](https://npmjs.com/package/@ivanmaxlogiudice/eslint-config)
5
+
6
+ Personal ESLint configuration
7
+
8
+ ## Getting Started
9
+
10
+ 1. Add the package to your devDependencies
11
+ ```bash
12
+ $ pnpm add -D eslint @ivanmaxlogiudice/eslint-config
13
+ ```
14
+
15
+ 2. Create a `.eslintrc` file
16
+ ```bash
17
+ {
18
+ "extends": ["@ivanmaxlogiudice/eslint-config"]
19
+ }
20
+ ```
21
+
22
+ ## TypeScript
23
+
24
+ If you're using TypeScript, follow [Getting Started](https://github.com/ivanlogiudice/eslint-config/tree/main/packages/eslint-config-ts#getting-started).
25
+
26
+ ## Vue 3 with TS
27
+
28
+ If you're using Vue 3, follow [Getting Started](https://github.com/ivanlogiudice/eslint-config/tree/main/packages/eslint-config-vue#getting-started).
package/index.js ADDED
@@ -0,0 +1,184 @@
1
+ module.exports = {
2
+ env: {
3
+ es6: true,
4
+ node: true,
5
+ browser: true
6
+ },
7
+ plugins: ['unicorn', 'tailwindcss'],
8
+ extends: [
9
+ 'standard',
10
+ 'plugin:import/recommended',
11
+ 'plugin:jsonc/recommended-with-jsonc',
12
+ 'plugin:tailwindcss/recommended'
13
+ ],
14
+ settings: {
15
+ 'import/resolver': {
16
+ node: { extensions: ['.js', '.mjs', '.ts', '.d.ts'] }
17
+ }
18
+ },
19
+ overrides: [
20
+ {
21
+ files: ['*.json', '*.json5'],
22
+ parser: 'jsonc-eslint-parser',
23
+ rules: {
24
+ 'quotes': ['error', 'double'],
25
+ 'quote-props': ['error', 'always'],
26
+ 'comma-dangle': ['error', 'never']
27
+ }
28
+ },
29
+ {
30
+ files: ['package.json'],
31
+ parser: 'jsonc-eslint-parser',
32
+ rules: {
33
+ 'jsonc/sort-keys': [
34
+ 'error',
35
+ {
36
+ pathPattern: '^$',
37
+ order: [
38
+ 'name',
39
+ 'version',
40
+ 'description',
41
+ 'keywords',
42
+ 'license',
43
+ 'repository',
44
+ 'funding',
45
+ 'author',
46
+ 'type',
47
+ 'files',
48
+ 'exports',
49
+ 'main',
50
+ 'module',
51
+ 'unpkg',
52
+ 'bin',
53
+ 'scripts',
54
+ 'husky',
55
+ 'lint-staged',
56
+ 'peerDependencies',
57
+ 'peerDependenciesMeta',
58
+ 'dependencies',
59
+ 'devDependencies',
60
+ 'eslintConfig'
61
+ ]
62
+ },
63
+ {
64
+ pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
65
+ order: { type: 'asc' }
66
+ }
67
+ ]
68
+ }
69
+ }
70
+ ],
71
+ rules: {
72
+ // import
73
+ 'import/order': 'error',
74
+ 'import/first': 'error',
75
+ 'import/no-mutable-exports': 'error',
76
+
77
+ // Common
78
+ 'semi': ['error', 'never'],
79
+ 'quotes': ['error', 'single', { avoidEscape: true }],
80
+ 'indent': [
81
+ 'error', 4,
82
+ {
83
+ SwitchCase: 1,
84
+ VariableDeclarator: 1,
85
+ outerIIFEBody: 1
86
+ }
87
+ ],
88
+ 'quote-props': ['error', 'consistent-as-needed'],
89
+ 'array-bracket-spacing': ['error', 'never'],
90
+ // 'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
91
+ 'curly': ['error', 'multi-or-nest', 'consistent'],
92
+ 'block-spacing': ['error', 'always'],
93
+ 'comma-spacing': ['error', { before: false, after: true }],
94
+ 'comma-style': ['error', 'last'],
95
+ 'comma-dangle': ['error', 'never'],
96
+ 'no-debugger': 'error',
97
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
98
+ 'no-cond-assign': ['error', 'always'],
99
+ 'func-call-spacing': ['error', 'never'],
100
+ 'key-spacing': [
101
+ 'error',
102
+ {
103
+ beforeColon: false,
104
+ afterColon: true
105
+ }
106
+ ],
107
+ 'no-use-before-define': [
108
+ 'error',
109
+ {
110
+ functions: false,
111
+ classes: false,
112
+ variables: true
113
+ }
114
+ ],
115
+ 'no-restricted-syntax': ['error', 'DebuggerStatement', 'LabeledStatement', 'WithStatement'],
116
+ 'object-curly-spacing': ['error', 'always'],
117
+ 'space-before-function-paren': ['error', 'never'],
118
+
119
+ // ES6
120
+ 'prefer-const': [
121
+ 'error',
122
+ {
123
+ destructuring: 'any',
124
+ ignoreReadBeforeAssign: true
125
+ }
126
+ ],
127
+ 'prefer-arrow-callback': [
128
+ 'error',
129
+ {
130
+ allowNamedFunctions: false,
131
+ allowUnboundThis: true
132
+ }
133
+ ],
134
+ 'object-shorthand': [
135
+ 'error',
136
+ 'always',
137
+ {
138
+ ignoreConstructors: false,
139
+ avoidQuotes: true
140
+ }
141
+ ],
142
+ 'prefer-rest-params': 'error',
143
+ 'prefer-spread': 'error',
144
+ 'prefer-template': 'error',
145
+ 'template-curly-spacing': 'error',
146
+ 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
147
+ 'generator-star-spacing': 'off',
148
+
149
+ // Best Practice
150
+ 'array-callback-return': 'error',
151
+ 'block-scoped-var': 'error',
152
+ 'complexity': ['off', 11],
153
+ 'eqeqeq': ['error', 'allow-null'],
154
+ 'no-alert': 'warn',
155
+ 'no-case-declarations': 'error',
156
+ 'no-multi-spaces': 'error',
157
+ 'no-multi-str': 'error',
158
+ 'no-with': 'error',
159
+ 'no-void': 'error',
160
+ 'no-useless-escape': 'off',
161
+ 'vars-on-top': 'error',
162
+ 'require-await': 'off',
163
+ 'no-return-assign': 'off',
164
+ 'operator-linebreak': ['error', 'before'],
165
+
166
+ // unicorns
167
+ 'unicorn/switch-case-braces': 'error',
168
+ 'unicorn/no-unnecessary-await': 'error',
169
+ 'unicorn/prefer-logical-operator-over-ternary': 'error',
170
+ 'unicorn/error-message': 'error',
171
+ 'unicorn/escape-case': 'error',
172
+ 'unicorn/no-array-instanceof': 'error',
173
+ 'unicorn/no-new-buffer': 'error',
174
+ 'unicorn/no-unsafe-regex': 'off',
175
+ 'unicorn/number-literal-case': 'error',
176
+ 'unicorn/prefer-exponentiation-operator': 'error',
177
+ 'unicorn/prefer-includes': 'error',
178
+ 'unicorn/prefer-starts-ends-with': 'error',
179
+ 'unicorn/prefer-text-content': 'error',
180
+ 'unicorn/prefer-type-error': 'error',
181
+ 'unicorn/throw-new-error': 'error',
182
+ 'unicorn/prefer-node-protocol': 'error'
183
+ }
184
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@ivanmaxlogiudice/eslint-config",
3
+ "version": "0.0.2",
4
+ "description": "Personal ESLint configuration",
5
+ "homepage": "https://ivanmaxlogiudice.com/",
6
+ "keywords": [
7
+ "eslint",
8
+ "config",
9
+ "javascript",
10
+ "js"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/ivanlogiudice/eslint-config.git",
16
+ "directory": "packages/eslint-config"
17
+ },
18
+ "author": "Iván Máximiliano, Lo Giudice <ivanmaxlogiudice@gmail.com>",
19
+ "files": [
20
+ "index.js"
21
+ ],
22
+ "bugs": {
23
+ "url": "https://github.com/ivanlogiudice/eslint-config/issues"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "peerDependencies": {
29
+ "eslint": ">=8.28.0"
30
+ },
31
+ "dependencies": {
32
+ "eslint-config-standard": "^17.0.0",
33
+ "eslint-plugin-import": "^2.26.0",
34
+ "eslint-plugin-jsonc": "^2.5.0",
35
+ "eslint-plugin-n": "^15.5.1",
36
+ "eslint-plugin-promise": "^6.1.1",
37
+ "eslint-plugin-tailwindcss": "^3.7.1",
38
+ "eslint-plugin-unicorn": "^45.0.1",
39
+ "jsonc-eslint-parser": "^2.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "eslint": "^8.29.0"
43
+ }
44
+ }