File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
src/converters/lintConfigs/rules Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ import { convertNoEmpty } from "./ruleConverters/no-empty";
175
175
import { convertNoEmptyInterface } from "./ruleConverters/no-empty-interface" ;
176
176
import { convertNoEmptyLineAfterOpeningBrace } from "./ruleConverters/no-empty-line-after-opening-brace" ;
177
177
import { convertNoEval } from "./ruleConverters/no-eval" ;
178
+ import { convertNoExecScript } from "./ruleConverters/no-exec-script" ;
178
179
import { convertNoExplicitAny } from "./ruleConverters/no-explicit-any" ;
179
180
import { convertNoFloatingPromises } from "./ruleConverters/no-floating-promises" ;
180
181
import { convertNoForIn } from "./ruleConverters/no-for-in" ;
@@ -362,6 +363,7 @@ export const ruleConverters = new Map([
362
363
[ "no-empty-line-after-opening-brace" , convertNoEmptyLineAfterOpeningBrace ] ,
363
364
[ "no-empty-nested-blocks" , convertNoEmptyNestedBlocks ] ,
364
365
[ "no-empty" , convertNoEmpty ] ,
366
+ [ "no-exec-script" , convertNoExecScript ] ,
365
367
[ "no-eval" , convertNoEval ] ,
366
368
[ "no-extra-semicolon" , convertNoExtraSemicolon ] ,
367
369
[ "no-floating-promises" , convertNoFloatingPromises ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../ruleConverter" ;
2
+
3
+ export const convertNoExecScript : RuleConverter = ( ) => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ruleArguments : [
8
+ {
9
+ message : "Forbidden call to execScript" ,
10
+ selector : 'CallExpression[callee.name="execScript"]' ,
11
+ }
12
+ ] ,
13
+ ruleName : "restricted-syntax" ,
14
+ } ,
15
+ ] ,
16
+ } ;
17
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoExecScript } from "../no-exec-script" ;
2
+
3
+ describe ( convertNoExecScript , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoExecScript ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleArguments : [
13
+ {
14
+ message : "Forbidden call to execScript" ,
15
+ selector : 'CallExpression[callee.name="execScript"]' ,
16
+ }
17
+ ] ,
18
+ ruleName : "restricted-syntax" ,
19
+ } ,
20
+ ] ,
21
+ } ) ;
22
+ } ) ;
23
+ } ) ;
You can’t perform that action at this time.
0 commit comments