This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
81 lines (80 loc) · 1.89 KB
/
.eslintrc.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
module.exports = {
plugins: [
'@typescript-eslint',
'unused-imports',
'prettier',
'header',
'require-extensions',
'import',
],
extends: [
'eslint:recommended',
'prettier',
'plugin:prettier/recommended',
'plugin:import/typescript',
],
settings: {
'import/resolver': {
typescript: {},
},
},
parserOptions: {
sourceType: 'module',
},
parser: '@typescript-eslint/parser',
env: {
es2020: true,
node: true,
jest: true,
},
root: true,
ignorePatterns: ['node_modules', 'build', 'dist'],
rules: {
'no-case-declarations': 'off',
'no-implicit-coercion': [2, { number: true, string: true, boolean: false }],
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
Buffer:
'Buffer usage increases bundle size and is not consistently implemented on web.',
},
extendDefaults: true,
},
],
'no-restricted-globals': [
'error',
{
name: 'Buffer',
message:
'Buffer usage increases bundle size and is not consistently implemented on web.',
},
],
'header/header': [
2,
'line',
[
' Copyright (c) Mysten Labs, Inc.',
' SPDX-License-Identifier: Apache-2.0',
],
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
},
],
'require-extensions/require-extensions': 'off',
'require-extensions/require-index': 'error',
'@typescript-eslint/consistent-type-imports': ['error'],
'import/no-cycle': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
},
};