Skip to content

Commit

Permalink
chore: Update lint command patterns to be more inclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeweiler committed Sep 18, 2021
1 parent ea6026b commit 7491922
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit ""
yarn run commitlint --edit ''
6 changes: 1 addition & 5 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"*.{js,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.js": "eslint --cache --fix"
"*.{js,ts,tsx}": yarn format:fix,
}
10 changes: 7 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'],
};
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app",
],
}
4 changes: 2 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
}
6 changes: 3 additions & 3 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ["@commitlint/config-conventional"],
rules: {
'subject-case': [2, 'always', 'sentence-case'],
"subject-case": [2, "always", "sentence-case"],
},
};
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint '*/**/*.{js,ts,tsx}'",
"lint:fix": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"lint": "eslint --ext .js --ext .ts --ext .tsx .",
"lint:fix": "eslint --ext .js --ext .ts --ext .tsx . --quiet --fix",
"format": "npm run lint && prettier --check .",
"format:fix": "npm run lint:fix && prettier --write .",
"pre-commit": "lint-staged",
Expand Down
16 changes: 8 additions & 8 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
import React from "react"
import { render, screen } from "@testing-library/react"
import App from "./App"

test('renders learn react link', () => {
render(<App />);
const header = screen.getByText('Threshold Token Dashboard');
expect(header).toBeInTheDocument();
});
test("renders learn react link", () => {
render(<App />)
const header = screen.getByText("Threshold Token Dashboard")
expect(header).toBeInTheDocument()
})
2 changes: 1 addition & 1 deletion src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="react-scripts" />
// <reference types="react-scripts" />
2 changes: 1 addition & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import "@testing-library/jest-dom"
10 changes: 2 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -20,7 +16,5 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
"include": ["src"]
}

0 comments on commit 7491922

Please sign in to comment.