Skip to content

Commit

Permalink
ci: add lint for filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Apr 6, 2023
1 parent 0890016 commit 1e74744
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
- name: Lint
run: yarn lint:eslint

lint-filename:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/provision

- name: File name checker
run: yarn lint:filename

audit:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ls:
.ts: regex:[a-z0-9\-\.]+
.tsx: regex:[a-z0-9\-\.]+
.js: regex:[a-z0-9\-\.]+

ignore:
- .git
- dist
- node_modules
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"build:test:watch": "cross-env NODE_ENV=test EXT_ENV=watch webpack --config webpack/webpack.config.prod.js",
"clean": "rm -rf ./dist",
"clean:all": "rm -rf ./dist && rm -rf ./coverage && rm -rf ./node_modules",
"lint": "concurrently -g 'yarn lint:prettier' 'yarn lint:unused-exports' 'yarn lint:deps' 'yarn lint:remote-wallet-config' 'yarn lint:eslint'",
"lint": "concurrently -g 'yarn lint:prettier' 'yarn lint:unused-exports' 'yarn lint:deps' 'yarn lint:remote-wallet-config' 'yarn lint:eslint' 'yarn lint:filename'",
"lint:eslint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:filename": "ls-lint",
"lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
"lint:prettier": "prettier --check \"{src,tests,tests-legacy}/**/*.{ts,tsx}\" \"*.{js,json}\"",
"lint:prettier:fix": "prettier --write \"{src,tests,tests-legacy}/**/*.{ts,tsx}\" *.js",
Expand Down Expand Up @@ -222,6 +223,7 @@
"@emotion/babel-plugin": "11.10.5",
"@emotion/babel-preset-css-prop": "11.10.0",
"@emotion/cache": "11.10.5",
"@ls-lint/ls-lint": "1.11.2",
"@playwright/test": "1.30.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@redux-devtools/cli": "2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FiInfo } from 'react-icons/fi';
import { Box, Fade, Stack, Tooltip, color } from '@stacks/ui';
import { SharedComponentsSelectors } from '@tests/selectors/shared-component.selectors';

import { FeeTypes } from '@shared/models/fees/_fees.model';
import { FeeTypes } from '@shared/models/fees/fees.model';

import { useOnClickOutside } from '@app/common/hooks/use-onclickoutside';
import { openInNewTab } from '@app/common/utils/open-in-new-tab';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FeeTypes } from '@shared/models/fees/_fees.model';
import { BitcoinFeeEstimate } from '@shared/models/fees/bitcoin-fees.model';
import { FeeTypes } from '@shared/models/fees/fees.model';
import { StacksFeeEstimate } from '@shared/models/fees/stacks-fees.model';

import { FeeEstimateItem } from './fee-estimate-item';
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/fees-row/fees-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SharedComponentsSelectors } from '@tests/selectors/shared-component.sel
import BigNumber from 'bignumber.js';
import { useField } from 'formik';

import { FeeTypes, Fees } from '@shared/models/fees/_fees.model';
import { FeeTypes, Fees } from '@shared/models/fees/fees.model';
import { createMoney } from '@shared/models/money.model';
import { isNumber, isString } from '@shared/utils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Form, Formik, FormikHelpers } from 'formik';
import { OptionalObjectSchema } from 'yup/lib/object';

import { HIGH_FEE_WARNING_LEARN_MORE_URL_STX } from '@shared/constants';
import { Fees } from '@shared/models/fees/_fees.model';
import { Fees } from '@shared/models/fees/fees.model';
import { StacksSendFormValues } from '@shared/models/form.model';
import { Money } from '@shared/models/money.model';
import { RouteUrls } from '@shared/route-urls';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FormikHelpers } from 'formik';

import { HIGH_FEE_AMOUNT_STX } from '@shared/constants';
import { FeeTypes } from '@shared/models/fees/_fees.model';
import { FeeTypes } from '@shared/models/fees/fees.model';
import { StacksSendFormValues } from '@shared/models/form.model';
import { Money } from '@shared/models/money.model';
import { isEmpty } from '@shared/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/transaction-request/components/fee-form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useFormikContext } from 'formik';

import { Fees } from '@shared/models/fees/_fees.model';
import { Fees } from '@shared/models/fees/fees.model';
import { StacksTransactionFormValues } from '@shared/models/form.model';

import { isTxSponsored } from '@app/common/transactions/stacks/transaction.utils';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/transaction-request/transaction-request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import get from 'lodash.get';
import * as yup from 'yup';

import { HIGH_FEE_WARNING_LEARN_MORE_URL_STX } from '@shared/constants';
import { FeeTypes } from '@shared/models/fees/_fees.model';
import { FeeTypes } from '@shared/models/fees/fees.model';
import { StacksTransactionFormValues } from '@shared/models/form.model';
import { RouteUrls } from '@shared/route-urls';

Expand Down
2 changes: 1 addition & 1 deletion src/app/query/stacks/fees/fees.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useMemo } from 'react';
import { StacksTransaction } from '@stacks/transactions';

import { logger } from '@shared/logger';
import { FeeCalculationTypes, Fees } from '@shared/models/fees/_fees.model';
import { FeeCalculationTypes, Fees } from '@shared/models/fees/fees.model';
import { StacksFeeEstimate, StacksTxFeeEstimation } from '@shared/models/fees/stacks-fees.model';
import { Money, createMoney } from '@shared/models/money.model';

Expand Down
2 changes: 1 addition & 1 deletion src/app/store/utils/vault-reducer-migration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalStorageMock } from '@tests-legacy/mocks/localStorage-mock';
import { LocalStorageMock } from '@tests-legacy/mocks/local-storage-mock';
import { vi } from 'vitest';

import { defaultKeyId } from '../keys/key.slice';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests-legacy/jest-unit.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Object.assign(global, require('jest-chrome'));

// setup jsdom inside `node` test environment
const JSDOM = require('jsdom').JSDOM;
const LocalStorageMock = require('@tests-legacy/mocks/localStorage-mock').LocalStorageMock;
const LocalStorageMock = require('@tests-legacy/mocks/local-storage-mock').LocalStorageMock;

const dom = new JSDOM('', { url: 'http://localhost/' });

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,11 @@
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==

"@ls-lint/[email protected]":
version "1.11.2"
resolved "https://registry.yarnpkg.com/@ls-lint/ls-lint/-/ls-lint-1.11.2.tgz#fa7e8c404b7c2f9f7fe3e92b7d69fe37a15c0e1c"
integrity sha512-kX+CCjgNz+NHCaOcFyJLSBLRgAoyOxN18QFLpgucz5ILvbr60BGjwKaoPYTv/rBV/77L+Oz82lpP24mzJ2wGsQ==

"@lukeed/csprng@^1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.0.1.tgz#625e93a0edb2c830e3c52ce2d67b9d53377c6a66"
Expand Down

0 comments on commit 1e74744

Please sign in to comment.