Skip to content

Commit 9ea2d5b

Browse files
committed
chore: relocate tests to prevent packaging, add preversion script
1 parent 97d6bca commit 9ea2d5b

File tree

12 files changed

+19
-17
lines changed

12 files changed

+19
-17
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ The `recommended` configuration is catered for TypeScript, and enforces stricter
5151

5252
### Rules
5353

54-
| Rule | Severity | Notes |
55-
| ------------------------------------------ | -------- | ----------------------------------------------- |
56-
| Indent: Tabs | ⚠️ Warn | |
57-
| JSDoc: Check tag names | ⚠️ Warn | |
58-
| JSDoc: No undefined types | ⚠️ Warn | |
59-
| JSDoc: Require JSDoc | ⚠️ Warn | |
60-
| TypeScript: Explicit function return types | ⚠️ Warn | Disabled for JavaScript, tests, and mock files. |
61-
| TypeScript: Explicit member accessibility | ⚠️ Warn | No `public` required `constructor`. |
62-
| TypeScript: Member ordering | ⚠️ Warn | Grouped by type, sub-grouped by accessibility. |
63-
| TypeScript: Sort type contituents | ⚠️ Warn | |
54+
| Rule | Severity | Notes |
55+
| ------------------------------------------ | -------- | ------------------------------------------------------------- |
56+
| Indent: Tabs | ⚠️ Warn | |
57+
| JSDoc: Check tag names | ⚠️ Warn | |
58+
| JSDoc: No undefined types | ⚠️ Warn | |
59+
| JSDoc: Require JSDoc | ⚠️ Warn | |
60+
| TypeScript: Explicit function return types | ⚠️ Warn | Disabled for JavaScript, tests, and mock files. |
61+
| TypeScript: Explicit member accessibility | ⚠️ Warn | No `public` required `constructor`. |
62+
| TypeScript: Member ordering | ⚠️ Warn | Grouped by type and then access, and ordered alphabetically . |
63+
| TypeScript: Sort type contituents | ⚠️ Warn | |
6464

6565
Additionally, the following rules are disabled for test and mock files:
6666

@@ -83,7 +83,7 @@ Additionally, the following rules are disabled for test and mock files:
8383

8484
## Member Ordering
8585

86-
Members of a class should be grouped by type, and then sub-grouped within those types by accessibility. The orders are as follows:
86+
Members of a class should be grouped by type and then by access, and ordered alphabetically. The ordersing is as follows:
8787

8888
**Type Order**
8989

@@ -93,7 +93,7 @@ Members of a class should be grouped by type, and then sub-grouped within those
9393
- Properties (get / set)
9494
- Methods
9595

96-
**Accessibility Order**
96+
**Access Order**
9797

9898
- Public (static / abstract / regular)
9999
- Protected (static / abstract / regular)

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { config } from "./src/index.js";
44

55
export default defineConfig([
66
{
7-
ignores: ["src/__tests__/recommended/**/*.ts"],
7+
ignores: ["tests/recommended/**/*.ts"],
88
extends: config.recommended,
99
},
1010
]);

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"lint": "eslint --max-warnings 0",
1212
"lint:fix": "prettier \"./src/**/*.js\" --write",
13+
"preversion": "npm run lint && npm test",
1314
"test": "vitest run",
1415
"test:watch": "vitest"
1516
},
@@ -20,7 +21,8 @@
2021
},
2122
"keywords": [
2223
"elgato",
23-
"eslint"
24+
"eslint",
25+
"linting"
2426
],
2527
"author": {
2628
"name": "Elgato",

src/__tests__/recommended.test.ts renamed to tests/recommended.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("recommended", () => {
3434
},
3535
])("$ruleId", async ({ ruleId, messages }) => {
3636
// Arrange.
37-
const files = [join("./src/__tests__/recommended/", `${ruleId}.ts`)];
37+
const files = [join("./tests/recommended/", `${ruleId}.ts`)];
3838
const eslint = new ESLint({
3939
overrideConfigFile: "src/recommended.js",
4040
});
File renamed without changes.

0 commit comments

Comments
 (0)