Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, replace husky #61

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "all"
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.exclude": {
"**/.dist": true
}
}
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const checkAltText = lintRule(
}
}
}
}
},
);

export default checkAltText;
10,622 changes: 2,535 additions & 8,087 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 17 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,31 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"pretest": "npm run lint",
"test": "jest",
"pretty-quick": "pretty-quick",
"prepare": "husky install",
"prepublishOnly": "tsc"
},
"author": "@double-great",
"license": "MIT",
"dependencies": {
"@double-great/alt-text": "^3.1.0",
"unified-lint-rule": "^2.1.1",
"unist-util-visit-parents": "^5.1.3"
"unified-lint-rule": "^2.1.2",
"unist-util-visit-parents": "^6.0.1"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@types/dedent": "^0.7.0",
"@types/jest": "^29.4.0",
"@types/node": "^18.14.4",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"dedent": "^0.7.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"husky": "^8.0.3",
"jest": "^29.4.3",
"prettier": "^2.8.4",
"pretty-quick": "^3.1.3",
"remark": "^14.0.2",
"typescript": "^4.9.5"
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@types/dedent": "^0.7.2",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.3",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"dedent": "^1.5.1",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.0",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"remark": "^15.0.1",
"typescript": "^5.3.2"
},
"directories": {
"test": "tests"
Expand Down
12 changes: 6 additions & 6 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("End in period", () => {
`);
expect(lint.messages.length).toEqual(1);
expect(lint.messages[0].reason).toMatchInlineSnapshot(
`"Alt text should end with punctuation (https://tinyurl.com/y9fcquhy)."`
`"Alt text should end with punctuation (https://tinyurl.com/y9fcquhy)."`,
);
});

Expand All @@ -52,7 +52,7 @@ describe("End in period", () => {

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
`,
{ "end-with-punctuation": false }
{ "end-with-punctuation": false },
);
expect(lint.messages.length).toEqual(0);
});
Expand All @@ -72,7 +72,7 @@ describe("Image is a link", () => {
`);
expect(lint.messages.length).toEqual(1);
expect(lint.messages[0].reason).toMatchInlineSnapshot(
`"Images inside a link tag require alt text that describes the purpose of the link (https://tinyurl.com/y7s7je5u)."`
`"Images inside a link tag require alt text that describes the purpose of the link (https://tinyurl.com/y7s7je5u)."`,
);
});

Expand All @@ -81,7 +81,7 @@ describe("Image is a link", () => {
dedent`
[![](https://site.com/image.png)](https://website.org)
`,
{ "image-is-link": false }
{ "image-is-link": false },
);
expect(lint.messages.length).toEqual(0);
});
Expand All @@ -98,7 +98,7 @@ describe("Empty alt text", () => {
`);
expect(lint.messages.length).toEqual(1);
expect(lint.messages[0].reason).toMatchInlineSnapshot(
`"Empty alt text should only be used for decorative images (https://tinyurl.com/y8mlwswv)."`
`"Empty alt text should only be used for decorative images (https://tinyurl.com/y8mlwswv)."`,
);
});

Expand All @@ -111,7 +111,7 @@ describe("Empty alt text", () => {
![](https://site.com/doggie.png)

`,
{ "image-is-decorative": false }
{ "image-is-decorative": false },
);
expect(lint.messages.length).toEqual(0);
});
Expand Down