Use Prettier for JS files (#3913)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Francisco
2023-01-04 11:03:40 -03:00
committed by GitHub
parent 88754d0b36
commit a28aafdc85
135 changed files with 2737 additions and 3121 deletions

View File

@ -1,7 +1,7 @@
const { isNodeType } = require('solidity-ast/utils');
const { slug } = require('./helpers');
module.exports.anchor = function anchor ({ item, contract }) {
module.exports.anchor = function anchor({ item, contract }) {
let res = '';
if (contract) {
res += contract.name + '-';
@ -37,13 +37,9 @@ module.exports['has-events'] = function ({ item }) {
module.exports['inherited-functions'] = function ({ item }) {
const { inheritance } = item;
const baseFunctions = new Set(
inheritance.flatMap(c => c.functions.flatMap(f => f.baseFunctions ?? [])),
);
const baseFunctions = new Set(inheritance.flatMap(c => c.functions.flatMap(f => f.baseFunctions ?? [])));
return inheritance.map((contract, i) => ({
contract,
functions: contract.functions.filter(f =>
!baseFunctions.has(f.id) && (f.name !== 'constructor' || i === 0),
),
functions: contract.functions.filter(f => !baseFunctions.has(f.id) && (f.name !== 'constructor' || i === 0)),
}));
};