Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit 7ad75aa

Browse files
author
Andres Adjimann
committed
feat: linter, prettier and solhint working
1 parent 8a0769b commit 7ad75aa

File tree

19 files changed

+1594
-408
lines changed

19 files changed

+1594
-408
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
**/.env
1+
.env
22
yarn.error.log
3+
yarn-error.log
34
.yalc
45
yalc.lock
56
coverage*

config-packages/eslint/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const path = require('path');
2-
const tsconfigPath = path.join(__dirname, './tsconfig.json');
32
module.exports = {
43
ignorePatterns: [
4+
'deployments/',
55
'artifacts/',
66
'cache/',
77
'coverage/',
8-
'node_modules/'
8+
'node_modules/',
9+
'typechain-types'
910
],
1011
root: true,
1112
extends: ['eslint:recommended', 'plugin:mocha/recommended', 'prettier'],
@@ -20,20 +21,21 @@ module.exports = {
2021
},
2122
overrides: [
2223
{
23-
files: ['*.ts'],
24+
files: ['*.ts', '*.tsx'],
2425
parser: '@typescript-eslint/parser',
2526
parserOptions: {
26-
project: [tsconfigPath],
27-
ecmaVersion: 2020,
28-
sourceType: 'module',
27+
project: ['./tsconfig.json'], // Specify it only for TypeScript files
28+
// project: [path.join(__dirname, './tsconfig.json')],
29+
// tsconfigRootDir: __dirname,
30+
// ecmaVersion: 2020,
31+
// sourceType: 'module',
2932
},
3033
plugins: ['mocha', '@typescript-eslint'],
3134
extends: [
3235
'eslint:recommended',
3336
'plugin:@typescript-eslint/recommended',
3437
'plugin:mocha/recommended',
3538
'prettier',
36-
'prettier/@typescript-eslint',
3739
],
3840
rules: {
3941
'@typescript-eslint/no-misused-promises': 'error',

config-packages/eslint/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
"main": "index.js",
55
"private": true,
66
"dependencies": {
7-
"eslint": "latest",
8-
"eslint-config-prettier": "latest"
7+
"@typescript-eslint/eslint-plugin": "^5.52.0",
8+
"@typescript-eslint/parser": "^5.52.0",
9+
"eslint": "^8.34.0",
10+
"eslint-config-prettier": "^8.6.0",
11+
"eslint-plugin-mocha": "^10.1.0"
912
}
1013
}

config-packages/mocha/index.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

config-packages/mocha/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

config-packages/prettier/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Right now we exclude files by .gitignore maybe someday prettier start supporting some ignore coniguration.
12
module.exports = {
23
singleQuote: true,
34
bracketSpacing: false,
@@ -8,8 +9,7 @@ module.exports = {
89
printWidth: 120,
910
tabWidth: 4,
1011
singleQuote: false,
11-
explicitTypes: 'always',
1212
},
1313
},
14-
],
14+
]
1515
};

config-packages/prettier/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"name": "prettier-config-custom",
33
"version": "0.0.1",
44
"main": "index.js",
5-
"private": true
5+
"private": true,
6+
"dependencies": {
7+
"prettier": "^2.8.4",
8+
"prettier-plugin-solidity": "^1.1.2"
9+
}
610
}

config-packages/solcover/index.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1+
// The only way to load this file is using a .solcover.js file :(
12
module.exports = {
2-
"extends": "solhint:recommended",
3-
"plugins": ["prettier"],
4-
"rules": {
5-
"prettier/prettier": [
6-
"error",
7-
{
8-
"endOfLine": "auto"
9-
}
10-
],
11-
"code-complexity": ["error", 7],
12-
"compiler-version": ["error", "^0.8.0"],
13-
"const-name-snakecase": "off",
14-
"func-name-mixedcase": "off",
15-
"constructor-syntax": "error",
16-
"func-visibility": ["error", {"ignoreConstructors": true}],
17-
"not-rely-on-time": "off",
18-
"no-inline-assembly": "off",
19-
"reason-string": ["warn", {"maxLength": 64}]
20-
}
21-
}
22-
3+
mocha: {
4+
grep: '@skip-on-coverage', // Find everything with this tag
5+
invert: true, // Run the grep's inverse set.
6+
},
7+
skipFiles: [],
8+
};

config-packages/solcover/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "solhint-config-custom",
2+
"name": "solcover-config-custom",
33
"version": "0.0.1",
44
"main": "index.js",
55
"private": true
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"name": "solcover-config-custom",
2+
"name": "solhint-config-custom",
33
"version": "0.0.1",
44
"main": "index.js",
5-
"private": true
5+
"private": true,
6+
"dependencies": {
7+
"solhint": "^3.3.8"
8+
}
69
}

0 commit comments

Comments
 (0)