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

chore: linting fixes and improvements #426

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 4 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Checks
on:
pull_request:
branches:
- master
- "*"
push:
branches:
- master
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Lint all commit messages
run: yarn commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
lint:
name: Lint JS files
name: Lint files and folders
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -41,6 +41,8 @@ jobs:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: LS-lint
run: yarn ls-lint
- name: ESlint
run: yarn eslint
test:
Expand Down
13 changes: 13 additions & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ls:
templates:
.hbs: snake_case
translations:
.json: kebab-case
src:
.dir: kebab-case
.js: camelCase | PascalCase
.spec.js: camelCase | PascalCase
.ts: camelCase | PascalCase

ignore:
- node_modules
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "concurrently -k -r 'rollup -c -w' 'wait-on script.js style.css && zcli themes:preview'",
"build": "rollup -c",
"eslint": "eslint src",
"ls-lint": "ls-lint",
"prepare": "husky install",
"download-locales": "node ./bin/update-translations",
"test": "jest",
Expand All @@ -32,6 +33,8 @@
"devDependencies": {
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@jest/globals": "^29.6.4",
"@ls-lint/ls-lint": "^2.0.1",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/Dropdown.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect, jest, describe, it, beforeEach } from "@jest/globals";
import crypto from "crypto";
import { fireEvent, screen } from "@testing-library/dom";
import userEvent from "@testing-library/user-event";
Expand Down
4 changes: 2 additions & 2 deletions src/modules/new-request-form/NewRequestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Footer = styled.div`
`;

const DatePicker = lazy(() => import("./fields/DatePicker"));
const CcField = lazy(() => import("./fields/CcField/CcField"));
const CcField = lazy(() => import("./fields/cc-field/CcField"));

export function NewRequestForm({
ticketForms,
Expand Down Expand Up @@ -115,7 +115,7 @@ export function NewRequestForm({
</Suspense>
);
case "multiselect":
return <MultiSelect field={field}/>;
return <MultiSelect field={field} />;
case "tagger":
return <div>tagger</div>;
case "due_at":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ interface ParentTicketFieldProps {
field: Field;
}

export function ParentTicketField({ field }: ParentTicketFieldProps): JSX.Element {
export function ParentTicketField({
field,
}: ParentTicketFieldProps): JSX.Element {
const { value, name } = field;
return (
<input
type="hidden"
name={name}
value={value}
/>
);
return <input type="hidden" name={name} value={value} />;
}
Loading