function verify(code, type, expectedNamesList) {
			linter.defineRules({
				test: {
					create(context) {
						const sourceCode = context.sourceCode;

						/**
						 * Assert `sourceCode.getDeclaredVariables(node)` is empty.
						 * @param {ASTNode} node A node to check.
						 * @returns {void}
						 */
						function checkEmpty(node) {
							assert.strictEqual(
								0,
								sourceCode.getDeclaredVariables(node).length,
							);
						}
						const rule = {
							Program: checkEmpty,
							EmptyStatement: checkEmpty,
							BlockStatement: checkEmpty,
							ExpressionStatement: checkEmpty,
							LabeledStatement: checkEmpty,
							BreakStatement: checkEmpty,
							ContinueStatement: checkEmpty,
							WithStatement: checkEmpty,
							SwitchStatement: checkEmpty,
							ReturnStatement: checkEmpty,
							ThrowStatement: checkEmpty,
							TryStatement: checkEmpty,
							WhileStatement: checkEmpty,
							DoWhileStatement: checkEmpty,
							ForStatement: checkEmpty,
							ForInStatement: checkEmpty,
							DebuggerStatement: checkEmpty,
							ThisExpression: checkEmpty,
							ArrayExpression: checkEmpty,
							ObjectExpression: checkEmpty,
							Property: checkEmpty,
							SequenceExpression: checkEmpty,
							UnaryExpression: checkEmpty,
							BinaryExpression: checkEmpty,
							AssignmentExpression: checkEmpty,
							UpdateExpression: checkEmpty,
							LogicalExpression: checkEmpty,
							ConditionalExpression: checkEmpty,
							CallExpression: checkEmpty,
							NewExpression: checkEmpty,
							MemberExpression: checkEmpty,
							SwitchCase: checkEmpty,
							Identifier: checkEmpty,
							Literal: checkEmpty,
							ForOfStatement: checkEmpty,
							ArrowFunctionExpression: checkEmpty,
							YieldExpression: checkEmpty,
							TemplateLiteral: checkEmpty,
							TaggedTemplateExpression: checkEmpty,
							TemplateElement: checkEmpty,
							ObjectPattern: checkEmpty,
							ArrayPattern: checkEmpty,
							RestElement: checkEmpty,
							AssignmentPattern: checkEmpty,
							ClassBody: checkEmpty,
							MethodDefinition: checkEmpty,
							MetaProperty: checkEmpty,
						};

						rule[type] = function (node) {
							const expectedNames = expectedNamesList.shift();
							const variables =
								sourceCode.getDeclaredVariables(node);

							assert(Array.isArray(expectedNames));
							assert(Array.isArray(variables));
							assert.strictEqual(
								expectedNames.length,
								variables.length,
							);
							for (let i = variables.length - 1; i >= 0; i--) {
								assert.strictEqual(
									expectedNames[i],
									variables[i].name,
								);
							}
						};
						return rule;
					},
				},
			});
			linter.verify(code, {
				rules: { test: 2 },
				parserOptions: {
					ecmaVersion: 6,
					sourceType: "module",
				},
			});

			// Check all expected names are asserted.
			assert.strictEqual(0, expectedNamesList.length);
		}
Assert `sourceCode.getDeclaredVariables(node)` is valid.
@param {string} code A code to check.
@param {string} type A type string of ASTNode. This method checks variables on the node of the type.
@param {Array<Array<string>>} expectedNamesList An array of expected variable names. The expected variable names is an array of string.
@returns {void}