Skip to content

Commit

Permalink
Merge pull request #108 from HearTao/preferConstantCall
Browse files Browse the repository at this point in the history
add config to control assume function is constant or not
  • Loading branch information
Kingwl committed Jan 15, 2021
2 parents 6ca16d2 + 44c6e8f commit 704d4e4
Show file tree
Hide file tree
Showing 27 changed files with 942 additions and 891 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/HearTao/ts-react-hooks-tools.git"
},
"version": "0.1.16",
"version": "0.1.17",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
Expand Down
7 changes: 6 additions & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Typescript React hooks Tools",
"description": "Useful refactor of React hooks with TypeScript.",
"publisher": "kingwl",
"version": "0.1.16",
"version": "0.1.17",
"license": "MIT",
"icon": "img/logo.png",
"repository": {
Expand Down Expand Up @@ -42,6 +42,11 @@
"type": "boolean",
"description": "Control whether if collect whole call expression as dependencies",
"default": true
},
"trht.preferConstantCall": {
"type": "boolean",
"description": "Control whether if assume call expression is constants",
"default": true
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const configurationSection = 'trht';

interface SynchronizedConfiguration {
preferFullAccess?: boolean;
preferImmutableCall?: boolean
preferImmutableCall?: boolean;
preferConstantCall?: boolean;
}

export async function activate(context: vscode.ExtensionContext) {
Expand Down Expand Up @@ -43,6 +44,7 @@ function getConfiguration(): SynchronizedConfiguration {

withConfigValue(config, outConfig, 'preferFullAccess');
withConfigValue(config, outConfig, 'preferImmutableCall');
withConfigValue(config, outConfig, 'preferConstantCall');

return outConfig;
}
Expand Down
Loading

0 comments on commit 704d4e4

Please sign in to comment.