Skip to content

Commit

Permalink
move files
Browse files Browse the repository at this point in the history
  • Loading branch information
cedeber committed Sep 8, 2024
1 parent b2be938 commit dcfe35d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.vscode
.github
/lib/tests
.vscode
/examples
/tests
eslint.config.js
4 changes: 2 additions & 2 deletions lib/index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";
import throwDocumentation from "./rules/throw-documentation.mjs";
import throwNaming from "./rules/throw-naming.mjs";
import throwDocumentation from "./rules/require-throws-doc.mjs";
import throwNaming from "./rules/throw-function-naming.mjs";

const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getThrowTypes } from "./utils.mjs";
import { getThrowTypes } from "../utils.mjs";

/**
* @type {import("eslint").Rule.RuleModule}
Expand All @@ -18,7 +18,7 @@ export default {
},
create(context) {
/** @param {(import("estree").ArrowFunctionExpression | (import("estree").FunctionDeclaration)) & import("eslint").Rule.NodeParentExtension} node */
function checkThrows(node) {
function checkFunctionForThrowsTag(node) {
const sourceCode = context.sourceCode;
const jsDocComment = sourceCode.getJSDocComment(node);

Expand Down Expand Up @@ -50,9 +50,9 @@ export default {
}

return {
ArrowFunctionExpression: checkThrows,
FunctionDeclaration: checkThrows,
FunctionExpression: checkThrows,
ArrowFunctionExpression: checkFunctionForThrowsTag,
FunctionDeclaration: checkFunctionForThrowsTag,
FunctionExpression: checkFunctionForThrowsTag,
};
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasThrowInBlock } from "./utils.mjs";
import { hasThrowInBlock } from "../utils.mjs";

/**
* @type {import("eslint").Rule.RuleModule}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import test from "ava";
import AvaRuleTester from "eslint-ava-rule-tester";
import rule from "../rules/throw-documentation.mjs";
import rule from "../lib/rules/require-throws-doc.mjs";

const ruleTester = new AvaRuleTester(test, {
languageOptions: { ecmaVersion: 2021, sourceType: "module" },
});

ruleTester.run("throw-documentation", rule, {
ruleTester.run("require-throws-doc", rule, {
/** @type {import("eslint").RuleTester.ValidTestCase[]} */
valid: [
// Function Declaration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from "ava";
import AvaRuleTester from "eslint-ava-rule-tester";
import rule from "../rules/throw-naming.mjs";
import rule from "../lib/rules/throw-function-naming.mjs";

const ruleTester = new AvaRuleTester(test, {
languageOptions: { ecmaVersion: 2021, sourceType: "module" },
Expand Down

0 comments on commit dcfe35d

Please sign in to comment.