forked from VilledeMontreal/authentication-nodejs-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslint.config.base.js
54 lines (54 loc) · 2.5 KB
/
.eslint.config.base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
plugins: ['@typescript-eslint', 'header', 'node', 'jest'],
extends: [
'airbnb-typescript/base',
'prettier',
'plugin:import/recommended',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:node/recommended',
// 'plugin:jest/recommended',
],
env: {
'jest/globals': true,
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'off', // Triggered with function parameters not used. Note that typescript compiler will take care of this when local vars are not used.
'@typescript-eslint/no-use-before-define': 'off',
'import/prefer-default-export': 'off',
'no-restricted-syntax': 'off',
'class-methods-use-this': 'off',
'no-await-in-loop': 'off',
'node/no-deprecated-api': ['warn'],
'node/no-unsupported-features/es-syntax': 'off',
'node/exports-style': ['error', 'module.exports'],
'node/file-extension-in-import': 'off',
'node/no-missing-import': 'off',
'node/no-unpublished-import': 'off',
'node/prefer-global/buffer': ['error', 'always'],
'node/prefer-global/console': ['error', 'always'],
'node/prefer-global/process': ['error', 'always'],
'node/prefer-global/url-search-params': ['error', 'always'],
'node/prefer-global/url': ['error', 'always'],
'node/prefer-promises/dns': 'error',
'node/prefer-promises/fs': 'error',
'header/header': [
2,
'block',
[
{
pattern: / \* Copyright \(c\) \d{4} Ville de Montreal\. All rights reserved\.[\r\n]+ \* Licensed under the MIT license\.[\r\n]+ \* See LICENSE file in the project root for full license information\.[\r\n]+/gm,
template: `\n * Copyright (c) ${new Date().getFullYear()} Ville de Montreal. All rights reserved.\n * Licensed under the MIT license.\n * See LICENSE file in the project root for full license information.\n `,
},
],
],
},
};