add solhint conf upon workspace creatton

pull/3181/head
yann300 2 years ago
parent 85e0c1795f
commit 92c39fd4d8
  1. 6
      apps/remix-ide/src/app/plugins/solhint.ts
  2. 3
      libs/remix-ui/workspace/src/lib/actions/workspace.ts

@ -5,7 +5,7 @@ const profile = {
name: 'solhint',
displayName: 'solhint',
description: 'lint solidity files',
methods: ['lint']
methods: ['lint', 'createConfigFile']
};
type Report = {
@ -22,6 +22,10 @@ export class Solhint extends Plugin {
super(profile);
}
async createConfigFile () {
await this.call('fileManager', 'writeFile', '.solhint.json', config)
}
async lint(fileName: string) {
const content = await this.call('fileManager', 'readFile', fileName)
const reporters = processStr(content, {

@ -88,6 +88,9 @@ export const createWorkspace = async (workspaceName: string, workspaceTemplateNa
await plugin.setWorkspace({ name: workspaceName, isLocalhost: false })
await plugin.workspaceCreated(workspaceName)
// add the solhint config file
await plugin.call('solhint', 'createConfigFile')
if (isGitRepo && createCommit) {
const name = await plugin.call('settings', 'get', 'settings/github-user-name')
const email = await plugin.call('settings', 'get', 'settings/github-email')

Loading…
Cancel
Save