eslint-plugin-no-implicit-any-function-args 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -6,6 +6,6 @@ export type Options = [
6
6
  ];
7
7
  export type MessageIds = 'noImplicitAnyArg';
8
8
  export declare const rules: {
9
- 'no-implicit-any-function-args': ESLintUtils.RuleModule<"noImplicitAnyArg", Options, ESLintUtils.RuleListener>;
9
+ 'no-implicit-any-function-args': ESLintUtils.RuleModule<"noImplicitAnyArg", Options, unknown, ESLintUtils.RuleListener>;
10
10
  };
11
11
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAE5C,eAAO,MAAM,KAAK;;CAoEjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAE5C,eAAO,MAAM,KAAK;;CAmEjB,CAAC"}
package/index.js CHANGED
@@ -10,8 +10,7 @@ exports.rules = {
10
10
  meta: {
11
11
  type: 'problem',
12
12
  docs: {
13
- description: 'No implicit any for a function argument is allowed.',
14
- requiresTypeChecking: true
13
+ description: 'No implicit any for a function argument is allowed.'
15
14
  },
16
15
  messages: {
17
16
  noImplicitAnyArg: 'Argument \'{{ name }}\' requires a type'
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AACvD,2CAAuC;AAEvC,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,GAAG,EAAE,CAAC,2EAA2E,CAClF,CAAC;AASW,QAAA,KAAK,GAAG;IACnB,+BAA+B,EAAE,UAAU,CAAsB;QAC/D,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,WAAW,EAAE,qDAAqD;gBAClE,oBAAoB,EAAE,IAAI;aAC3B;YACD,QAAQ,EAAE;gBACR,gBAAgB,EAAE,yCAAyC;aAC5D;YACD,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,aAAa,EAAE;4BACb,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF,CAAC;SACH;QACD,cAAc,EAAE,CAAC,EAAE,CAAC;QACpB,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;;YAC7B,IACE,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc;gBAClC,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO;gBAC1C,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,qBAAqB,EACxD;gBACA,MAAM,IAAI,KAAK,CACb,gLAAgL,CACjL,CAAC;aACH;YAED,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAE1F,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;YAClD,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,cAAc,EAAE,CAAC;YAEtD,SAAS,YAAY,CAAC,IAAS;;gBAC7B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;oBAC/B,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;wBACzC,MAAM,eAAe,GAAG,MAAA,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,0CAAE,qBAAqB,0CAAE,GAAG,CAAC,KAAK,CAAC,CAAC;wBAC7F,IAAI,CAAC,eAAe;4BAAE,SAAS;wBAE/B,MAAM,IAAI,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC;wBAC7D,IAAI,CAAC,IAAI;4BAAE,SAAS;wBAEpB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,sBAAS,CAAC,GAAG,CAAC,KAAK,CAAC;4BAAE,SAAS;wBACjD,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;4BAAE,SAAS;wBAE5C,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,KAAK;4BACX,SAAS,EAAE,kBAAkB;4BAC7B,IAAI,EAAE;gCACJ,IAAI,EAAE,KAAK,CAAC,IAAI;6BACjB;yBACF,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;YAED,OAAO;gBACL,mBAAmB,EAAE,YAAY;gBACjC,kBAAkB,EAAE,YAAY;gBAChC,uBAAuB,EAAE,YAAY;aACtC,CAAC;QACJ,CAAC;KACF,CAAC;CACH,CAAC","sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils';\nimport { TypeFlags } from 'typescript';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/fast-facts/eslint-plugin-no-implicit-any-function-args'\n);\n\nexport type Options = [\n {\n ignorePattern?: string,\n }\n];\nexport type MessageIds = 'noImplicitAnyArg';\n\nexport const rules = {\n 'no-implicit-any-function-args': createRule<Options, MessageIds>({\n name: 'no-implicit-any-function-args',\n meta: {\n type: 'problem',\n docs: {\n description: 'No implicit any for a function argument is allowed.',\n requiresTypeChecking: true\n },\n messages: {\n noImplicitAnyArg: 'Argument \\'{{ name }}\\' requires a type'\n },\n schema: [{\n type: 'object',\n properties: {\n ignorePattern: {\n type: 'string'\n }\n }\n }]\n },\n defaultOptions: [{}],\n create: (context, [options]) => {\n if (\n !context.sourceCode.parserServices ||\n !context.sourceCode.parserServices.program ||\n !context.sourceCode.parserServices.esTreeNodeToTSNodeMap\n ) {\n throw new Error(\n 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the \"parserOptions.project\" property for @typescript-eslint/parser.'\n );\n }\n\n const ignoreRegex = options.ignorePattern ? new RegExp(options.ignorePattern) : undefined;\n\n const service = context.sourceCode.parserServices;\n const typeChecker = service.program?.getTypeChecker();\n\n function functionTest(node: any) {\n for (const param of node.params) {\n if (!param.typeAnnotation && !param.right) {\n const typescriptParam = context.sourceCode.parserServices?.esTreeNodeToTSNodeMap?.get(param);\n if (!typescriptParam) continue;\n\n const type = typeChecker?.getTypeAtLocation(typescriptParam);\n if (!type) continue;\n\n if ((type.flags & TypeFlags.Any) === 0) continue;\n if (ignoreRegex?.test(param.name)) continue;\n\n context.report({\n node: param,\n messageId: 'noImplicitAnyArg',\n data: {\n name: param.name\n }\n });\n }\n }\n }\n\n return {\n FunctionDeclaration: functionTest,\n FunctionExpression: functionTest,\n ArrowFunctionExpression: functionTest\n };\n }\n })\n};"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AACvD,2CAAuC;AAEvC,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,GAAG,EAAE,CAAC,2EAA2E,CAClF,CAAC;AASW,QAAA,KAAK,GAAG;IACnB,+BAA+B,EAAE,UAAU,CAAsB;QAC/D,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS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AAC,eAAe,CAAC,CAAC;wBAC7D,IAAI,CAAC,IAAI;4BAAE,SAAS;wBAEpB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,sBAAS,CAAC,GAAG,CAAC,KAAK,CAAC;4BAAE,SAAS;wBACjD,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;4BAAE,SAAS;wBAE5C,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,KAAK;4BACX,SAAS,EAAE,kBAAkB;4BAC7B,IAAI,EAAE;gCACJ,IAAI,EAAE,KAAK,CAAC,IAAI;6BACjB;yBACF,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;YAED,OAAO;gBACL,mBAAmB,EAAE,YAAY;gBACjC,kBAAkB,EAAE,YAAY;gBAChC,uBAAuB,EAAE,YAAY;aACtC,CAAC;QACJ,CAAC;KACF,CAAC;CACH,CAAC","sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils';\nimport { TypeFlags } from 'typescript';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/fast-facts/eslint-plugin-no-implicit-any-function-args'\n);\n\nexport type Options = [\n {\n ignorePattern?: string,\n }\n];\nexport type MessageIds = 'noImplicitAnyArg';\n\nexport const rules = {\n 'no-implicit-any-function-args': createRule<Options, MessageIds>({\n name: 'no-implicit-any-function-args',\n meta: {\n type: 'problem',\n docs: {\n description: 'No implicit any for a function argument is allowed.'\n },\n messages: {\n noImplicitAnyArg: 'Argument \\'{{ name }}\\' requires a type'\n },\n schema: [{\n type: 'object',\n properties: {\n ignorePattern: {\n type: 'string'\n }\n }\n }]\n },\n defaultOptions: [{}],\n create: (context, [options]) => {\n if (\n !context.sourceCode.parserServices ||\n !context.sourceCode.parserServices.program ||\n !context.sourceCode.parserServices.esTreeNodeToTSNodeMap\n ) {\n throw new Error(\n 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the \"parserOptions.project\" property for @typescript-eslint/parser.'\n );\n }\n\n const ignoreRegex = options.ignorePattern ? new RegExp(options.ignorePattern) : undefined;\n\n const service = context.sourceCode.parserServices;\n const typeChecker = service.program?.getTypeChecker();\n\n function functionTest(node: any) {\n for (const param of node.params) {\n if (!param.typeAnnotation && !param.right) {\n const typescriptParam = context.sourceCode.parserServices?.esTreeNodeToTSNodeMap?.get(param);\n if (!typescriptParam) continue;\n\n const type = typeChecker?.getTypeAtLocation(typescriptParam);\n if (!type) continue;\n\n if ((type.flags & TypeFlags.Any) === 0) continue;\n if (ignoreRegex?.test(param.name)) continue;\n\n context.report({\n node: param,\n messageId: 'noImplicitAnyArg',\n data: {\n name: param.name\n }\n });\n }\n }\n }\n\n return {\n FunctionDeclaration: functionTest,\n FunctionExpression: functionTest,\n ArrowFunctionExpression: functionTest\n };\n }\n })\n};"]}
package/index.spec.js CHANGED
@@ -4,15 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const rule_tester_1 = require("@typescript-eslint/rule-tester");
5
5
  const _1 = require(".");
6
6
  const path = tslib_1.__importStar(require("path"));
7
- const ruleTester = new rule_tester_1.RuleTester({
8
- parser: require.resolve('@typescript-eslint/parser'),
9
- parserOptions: {
10
- ecmaVersion: 2018,
11
- sourceType: 'module',
12
- tsconfigRootDir: path.resolve(__dirname, '..'),
13
- project: './tsconfig.spec.json'
14
- }
15
- });
7
+ const ruleTester = new rule_tester_1.RuleTester();
16
8
  ruleTester.run('no-implicit-any-function-args', _1.rules['no-implicit-any-function-args'], {
17
9
  valid: [
18
10
  getValidTestCase('const f = (a:number, b:number) => null'),
@@ -27,11 +19,8 @@ ruleTester.run('no-implicit-any-function-args', _1.rules['no-implicit-any-functi
27
19
  getInvalidTestCase('_ => null', [{ ignorePattern: '^_' }]),
28
20
  ],
29
21
  invalid: [
30
- getInvalidTestCase('const f = (a:number, b) => null'),
31
22
  getInvalidTestCase('const f = (a:number, b) => null'),
32
23
  getInvalidTestCase('function f(a:number, b) {}'),
33
- getInvalidTestCase('function f(a:number, b) {}'),
34
- getInvalidTestCase('(a:number, b) => null'),
35
24
  getInvalidTestCase('(a:number, b) => null'),
36
25
  getInvalidTestCase('_ => null'),
37
26
  ]
@@ -40,7 +29,15 @@ function getValidTestCase(code, options) {
40
29
  return {
41
30
  code,
42
31
  options: options || [{}],
43
- filename: 'src/fixtures/file.ts'
32
+ filename: 'src/fixtures/file.ts',
33
+ languageOptions: {
34
+ parserOptions: {
35
+ ecmaVersion: 2018,
36
+ sourceType: 'module',
37
+ tsconfigRootDir: path.resolve(__dirname, '..'),
38
+ project: './tsconfig.spec.json'
39
+ }
40
+ }
44
41
  };
45
42
  }
46
43
  function getInvalidTestCase(code, options) {
@@ -48,7 +45,15 @@ function getInvalidTestCase(code, options) {
48
45
  code,
49
46
  options: options || [{}],
50
47
  errors: [{ messageId: 'noImplicitAnyArg' }],
51
- filename: 'src/fixtures/file.ts'
48
+ filename: 'src/fixtures/file.ts',
49
+ languageOptions: {
50
+ parserOptions: {
51
+ ecmaVersion: 2018,
52
+ sourceType: 'module',
53
+ tsconfigRootDir: path.resolve(__dirname, '..'),
54
+ project: './tsconfig.spec.json'
55
+ }
56
+ }
52
57
  };
53
58
  }
54
59
  //# sourceMappingURL=index.spec.js.map
package/index.spec.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;;AAAA,gEAA4D;AAE5D,wBAA+C;AAC/C,mDAA6B;AAE7B,MAAM,UAAU,GAAG,IAAI,wBAAU,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC;IACpD,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC;QAC9C,OAAO,EAAE,sBAAsB;KAChC;CACF,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,CAAC,+BAA+B,EAAE,QAAK,CAAC,+BAA+B,CAAC,EAAE;IACtF,KAAK,EAAE;QACL,gBAAgB,CAAC,wCAAwC,CAAC;QAC1D,gBAAgB,CAAC,qCAAqC,CAAC;QACvD,gBAAgB,CAAC,mCAAmC,CAAC;QACrD,gBAAgB,CAAC,gCAAgC,CAAC;QAClD,gBAAgB,CAAC,8BAA8B,CAAC;QAChD,gBAAgB,CAAC,2BAA2B,CAAC;QAC7C,gBAAgB,CAAC,qDAAqD,CAAC;QACvE,gBAAgB,CAAC,oEAAoE,CAAC;QACtF,6GAA6G;QAC7G,kBAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;KAC3D;IAED,OAAO,EAAE;QACP,kBAAkB,CAAC,iCAAiC,CAAC;QACrD,kBAAkB,CAAC,iCAAiC,CAAC;QACrD,kBAAkB,CAAC,4BAA4B,CAAC;QAChD,kBAAkB,CAAC,4BAA4B,CAAC;QAChD,kBAAkB,CAAC,uBAAuB,CAAC;QAC3C,kBAAkB,CAAC,uBAAuB,CAAC;QAC3C,kBAAkB,CAAC,WAAW,CAAC;KAChC;CACF,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,IAAY,EAAE,OAAiB;IACvD,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACxB,QAAQ,EAAE,sBAAsB;KACjC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,OAAiB;IACzD,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;QAC3C,QAAQ,EAAE,sBAAsB;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import { RuleTester } from '@typescript-eslint/rule-tester';\nimport { TSESLint } from '@typescript-eslint/utils';\nimport { rules, Options, MessageIds } from '.';\nimport * as path from 'path';\n\nconst ruleTester = new RuleTester({\n parser: require.resolve('@typescript-eslint/parser'),\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n tsconfigRootDir: path.resolve(__dirname, '..'),\n project: './tsconfig.spec.json'\n }\n});\n\nruleTester.run('no-implicit-any-function-args', rules['no-implicit-any-function-args'], {\n valid: [\n getValidTestCase('const f = (a:number, b:number) => null'),\n getValidTestCase('const f = (a:number, b = 0) => null'),\n getValidTestCase('function f(a:number, b:number) {}'),\n getValidTestCase('function f(a:number, b = 0) {}'),\n getValidTestCase('(a:number, b:number) => null'),\n getValidTestCase('(a:number, b = 0) => null'),\n getValidTestCase('const f: (a:number, b = 0) => null = (a, b) => null'),\n getValidTestCase('function f(a: number, b: (b: number) => null) { }; f(1, b => null)'),\n // getValidTestCase('const f: (a:number, b: any) => null = (a, b) => null'), // Try and figure this out later\n getInvalidTestCase('_ => null', [{ ignorePattern: '^_' }]),\n ],\n\n invalid: [\n getInvalidTestCase('const f = (a:number, b) => null'),\n getInvalidTestCase('const f = (a:number, b) => null'),\n getInvalidTestCase('function f(a:number, b) {}'),\n getInvalidTestCase('function f(a:number, b) {}'),\n getInvalidTestCase('(a:number, b) => null'),\n getInvalidTestCase('(a:number, b) => null'),\n getInvalidTestCase('_ => null'),\n ]\n});\n\nfunction getValidTestCase(code: string, options?: Options): TSESLint.ValidTestCase<Options> {\n return {\n code,\n options: options || [{}],\n filename: 'src/fixtures/file.ts'\n };\n}\n\nfunction getInvalidTestCase(code: string, options?: Options): TSESLint.InvalidTestCase<MessageIds, Options> {\n return {\n code,\n options: options || [{}],\n errors: [{ messageId: 'noImplicitAnyArg' }],\n filename: 'src/fixtures/file.ts'\n };\n}\n"]}
1
+ {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;;AAAA,gEAA4F;AAC5F,wBAA+C;AAC/C,mDAA6B;AAE7B,MAAM,UAAU,GAAG,IAAI,wBAAU,EAAE,CAAC;AAEpC,UAA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ACf,aAAa,EAAE;gBACb,WAAW,EAAE,IAAI;gBACjB,UAAU,EAAE,QAAQ;gBACpB,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC;gBAC9C,OAAO,EAAE,sBAAsB;aAChC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { InvalidTestCase, RuleTester, ValidTestCase } from '@typescript-eslint/rule-tester';\nimport { rules, Options, MessageIds } from '.';\nimport * as path from 'path';\n\nconst ruleTester = new RuleTester();\n\nruleTester.run('no-implicit-any-function-args', rules['no-implicit-any-function-args'], {\n valid: [\n getValidTestCase('const f = (a:number, b:number) => null'),\n getValidTestCase('const f = (a:number, b = 0) => null'),\n getValidTestCase('function f(a:number, b:number) {}'),\n getValidTestCase('function f(a:number, b = 0) {}'),\n getValidTestCase('(a:number, b:number) => null'),\n getValidTestCase('(a:number, b = 0) => null'),\n getValidTestCase('const f: (a:number, b = 0) => null = (a, b) => null'),\n getValidTestCase('function f(a: number, b: (b: number) => null) { }; f(1, b => null)'),\n // getValidTestCase('const f: (a:number, b: any) => null = (a, b) => null'), // Try and figure this out later\n getInvalidTestCase('_ => null', [{ ignorePattern: '^_' }]),\n ],\n\n invalid: [\n getInvalidTestCase('const f = (a:number, b) => null'),\n getInvalidTestCase('function f(a:number, b) {}'),\n getInvalidTestCase('(a:number, b) => null'),\n getInvalidTestCase('_ => null'),\n ]\n});\n\nfunction getValidTestCase(code: string, options?: Options): ValidTestCase<Options> {\n return {\n code,\n options: options || [{}],\n filename: 'src/fixtures/file.ts',\n languageOptions: {\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n tsconfigRootDir: path.resolve(__dirname, '..'),\n project: './tsconfig.spec.json'\n }\n }\n };\n}\n\nfunction getInvalidTestCase(code: string, options?: Options): InvalidTestCase<MessageIds, Options> {\n return {\n code,\n options: options || [{}],\n errors: [{ messageId: 'noImplicitAnyArg' }],\n filename: 'src/fixtures/file.ts',\n languageOptions: {\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n tsconfigRootDir: path.resolve(__dirname, '..'),\n project: './tsconfig.spec.json'\n }\n }\n };\n}\n"]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "eslint-plugin-no-implicit-any-function-args",
3
- "version": "1.2.7",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "clean": "rimraf dist",
7
+ "clean": "rm -rf dist",
8
8
  "lint": "eslint . --ext .ts",
9
9
  "prebuild": "npm run clean",
10
10
  "build": "tsc",
@@ -16,23 +16,22 @@
16
16
  "author": "",
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
- "@typescript-eslint/utils": "^7.5.0"
19
+ "@typescript-eslint/utils": "^8.4.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "typescript": "^4.2.4 || ^5.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/jest": "^29.5.12",
26
- "@types/node": "^20.12.2",
27
- "@typescript-eslint/eslint-plugin": "^7.5.0",
28
- "@typescript-eslint/parser": "^7.5.0",
29
- "@typescript-eslint/rule-tester": "^7.5.0",
26
+ "@types/node": "^22.5.2",
27
+ "@typescript-eslint/eslint-plugin": "^8.4.0",
28
+ "@typescript-eslint/parser": "^8.4.0",
29
+ "@typescript-eslint/rule-tester": "^8.4.0",
30
30
  "copyfiles": "^2.4.1",
31
31
  "eslint": "^8.57.0",
32
- "eslint-plugin-deprecation": "^2.0.0",
33
32
  "jest": "^29.7.0",
34
- "rimraf": "^5.0.5",
35
33
  "ts-api-utils": "^1.3.0",
36
- "ts-jest": "^29.1.2"
34
+ "ts-jest": "^29.2.5",
35
+ "tslib": "^2.7.0"
37
36
  }
38
37
  }