@hs-web-team/eslint-config-node 0.1.0
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.
- package/.github/CODEOWNERS +1 -0
- package/README.md +42 -0
- package/index.js +40 -0
- package/package.json +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @HubSpotWebTeam/webteamdevs
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Hubspot Marketing WebTeam ESLing rules for Node.js
|
|
2
|
+
|
|
3
|
+
This is a list of ESLint rules that are recommended for use with **Hubspot Marketing WebTeam** projects.
|
|
4
|
+
|
|
5
|
+
<!-- index-start -->
|
|
6
|
+
|
|
7
|
+
## Index
|
|
8
|
+
|
|
9
|
+
- [Setup](#setup)
|
|
10
|
+
- [Where to use it](#where-to-use-it)
|
|
11
|
+
<!-- index-end -->
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
1. Install as dev dependency
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm i -D @hs-web-team/eslint-config-node
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. Add to `.eslintrc` in project root directory
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"extends": "@hs-web-team/eslint-config-node"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. Extend the eslint on a project basis by adding rules to `.eslintrc` e.g.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
{
|
|
33
|
+
"extends": "@hs-web-team/eslint-config-node",
|
|
34
|
+
"settings": {
|
|
35
|
+
"import/resolver": "webpack"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Where to use it
|
|
41
|
+
|
|
42
|
+
This package is intended to be used as a starting point for ESLint rules for Backend Node.js projects, and not for use in browser environments.
|
package/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
commonjs: true,
|
|
4
|
+
es2021: true,
|
|
5
|
+
node: true,
|
|
6
|
+
},
|
|
7
|
+
ignorePatterns: [
|
|
8
|
+
'/node_modules/',
|
|
9
|
+
'/.serverless/',
|
|
10
|
+
|
|
11
|
+
'/.eslintrc.js',
|
|
12
|
+
'/.webpack/',
|
|
13
|
+
],
|
|
14
|
+
extends: ['airbnb-base'],
|
|
15
|
+
parserOptions: {
|
|
16
|
+
ecmaVersion: 'latest',
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
'no-console': 0,
|
|
20
|
+
camelcase: 0,
|
|
21
|
+
'comma-dangle': 1,
|
|
22
|
+
'arrow-parens': 0,
|
|
23
|
+
'no-plusplus': 0,
|
|
24
|
+
'no-underscore-dangle': 0,
|
|
25
|
+
'no-confusing-arrow': 0,
|
|
26
|
+
'import/no-unresolved': 0,
|
|
27
|
+
'no-trailing-spaces': [2, { skipBlankLines: true }],
|
|
28
|
+
'no-unused-expressions': [1, { allowTernary: true }],
|
|
29
|
+
'max-len': [
|
|
30
|
+
2,
|
|
31
|
+
{
|
|
32
|
+
code: 120,
|
|
33
|
+
ignoreStrings: true,
|
|
34
|
+
ignoreTemplateLiterals: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'operator-linebreak': 0,
|
|
38
|
+
'implicit-arrow-linebreaks': 0,
|
|
39
|
+
},
|
|
40
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hs-web-team/eslint-config-node",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "HubSpot Marketing WebTeam ESLint rules for Node.js",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "npx eslint -c ./index.js *.js --fix",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/HubSpotWebTeam/wt-eslint-node.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"eslint"
|
|
16
|
+
],
|
|
17
|
+
"author": "Alessio Michelini & David Mooney",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/HubSpotWebTeam/wt-eslint-node/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/HubSpotWebTeam/wt-eslint-node#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"eslint": "^8.14.0",
|
|
25
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
26
|
+
"eslint-plugin-import": "^2.26.0"
|
|
27
|
+
}
|
|
28
|
+
}
|