Skip to content

Commit bfdd790

Browse files
committed
[+] Config: .editorconfig & .eslintrc.js
1 parent 5155aa5 commit bfdd790

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

config/.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Documentation: https://editorconfig.org/
2+
# VSCode Extension: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig
3+
4+
# Defines this as the top-most EditorConfig file (project scoped)
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
# Soft tabs (space character) set to 2 spaces
10+
# @see https://github.com/airbnb/javascript#whitespace--spaces
11+
indent_style = space
12+
indent_size = 2
13+
# End files with a single newline character (LF)
14+
# @see https://github.com/airbnb/javascript#whitespace--newline-at-end
15+
insert_final_newline = true
16+
end_of_line = lf
17+
# Avoid trailing spaces at the end of lines (trim whitespace)
18+
# @see https://github.com/airbnb/javascript#whitespace--no-trailing-spaces
19+
trim_trailing_whitespace = true
20+
# Avoid having lines of code that are longer than 100 characters
21+
# @see https://github.com/airbnb/javascript#whitespace--max-len
22+
max_line_length = 100
23+
24+
[*.md]
25+
trim_trailing_whitespace = false

config/.eslintrc.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = {
2+
// Defines the directory of this file as the root of the project
3+
root: true,
4+
/**
5+
* Environments which the project is designed to run, providing all predefined global variables.
6+
* @example process.env.NODE_ENV
7+
*/
8+
env: {
9+
browser: true,
10+
node: true,
11+
},
12+
// Configurations (set of rules)
13+
extends: [
14+
/**
15+
* Airbnb JavaScript Style Guide
16+
* @see https://github.com/airbnb/javascript
17+
*/
18+
'airbnb-base',
19+
/**
20+
* Vue Style Guide
21+
* @see https://vuejs.org/style-guide/
22+
* @see https://eslint.vuejs.org
23+
*/
24+
'plugin:vue/recommended',
25+
/**
26+
* Nuxt specific rules
27+
* @see https://github.com/nuxt/eslint-plugin-nuxt#bulb-rules
28+
*/
29+
'plugin:nuxt/recommended',
30+
],
31+
// Extends or overrides a set of rules
32+
rules: {
33+
/**
34+
* Keeps the rule that disallow the use of the console, but only in a production environment,
35+
* so that you can still use it in the development phase.
36+
* @see https://eslint.org/docs/rules/no-console
37+
*/
38+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
39+
/**
40+
* Keeps the rule that disallow the use of the debugger, but only in a production environment,
41+
* so that you can still use it in the development phase.
42+
* @see https://eslint.org/docs/rules/no-debugger
43+
*/
44+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
45+
},
46+
};

0 commit comments

Comments
 (0)