Skip to content

Commit

Permalink
chore(deps): update prettier (#280)
Browse files Browse the repository at this point in the history
* chore(deps): update prettier

* chore(deps): update prettier

* chore(deps): update prettier

* chore(deps): update files
  • Loading branch information
thedoublejay authored Sep 1, 2022
1 parent 43f2ff0 commit f563bc6
Show file tree
Hide file tree
Showing 100 changed files with 11,285 additions and 8,718 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
90 changes: 83 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,87 @@
"project": "./tsconfig.json"
},
"extends": [
"standard-with-typescript",
"standard-jsx",
"next",
"next/core-web-vitals"
"next/core-web-vitals",
"airbnb",
"airbnb-typescript",
"prettier"
],
"ignorePatterns": [
"*.json"
],
"plugins": [
"prettier"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [
".ts",
".tsx"
]
}
],
"react/prop-types": "off",
"import/extensions": "off",
"no-undef": "warn",
"react/jsx-props-no-spreading": "off",
"react/require-default-props": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": [
"Link"
],
"specialLink": [
"hrefLeft",
"hrefRight"
],
"aspects": [
"invalidHref",
"preferButton"
]
}
],
// Temporary warning as moving from Standard to Airbnb
"react/destructuring-assignment": "off",
"react/no-unused-prop-types": "off",
"@typescript-eslint/no-use-before-define": "off",
"react-hooks/exhaustive-deps": "off",
"react/jsx-no-constructed-context-values": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/button-has-type": "off",
"no-nested-ternary": "off",
"arrow-body-style": "off",
"no-restricted-syntax": "off",
"import/prefer-default-export": "off",
"no-param-reassign": "off",
"prefer-destructuring": "off",
"react/jsx-no-useless-fragment": "off",
"object-shorthand": "off",
"@typescript-eslint/no-shadow": "off",
"import/order": "off",
"no-else-return": "off",
"react/no-unescaped-entities": "off",
"default-case": "off",
"no-unsafe-optional-chaining": "off",
"react/no-array-index-key": "off",
"no-restricted-globals": "off",
"no-await-in-loop": "off",
"consistent-return": "off",
"react/no-unstable-nested-components": "off",
"react/jsx-no-bind": "off",
"no-restricted-properties": "off",
"prefer-exponentiation-operator": "off",
"@typescript-eslint/return-await": "off",
"import/no-cycle": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-unused-expressions": "off",
"no-underscore-dangle": "off",
"global-require": "off",
"curly": [
"error",
"all"
Expand All @@ -29,13 +99,19 @@
"no-void": "off",
"import/no-default-export": "error",
"multiline-ternary": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"no-restricted-imports": [
"error",
"warn",
{
"name": "next/link",
"message": "Please use @components/commons/Link instead."
},
{
"name": "next/head",
"message": "Please use @components/commons/Head instead."
}
]
],
"@typescript-eslint/default-param-last": "warn"
},
"overrides": [
{
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
lint:
name: Lint
name: Lint - Typescript and ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
Expand All @@ -22,4 +22,20 @@ jobs:
cache: 'npm'

- run: npm ci
- run: npx --no-install eslint src cypress
- run: tsc
- run: npm run lint

lint_prettier:
name: Lint - Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
with:
node-version: 16
cache: npm

- run: npm ci
- run: npx pretty-quick --staged --check --pattern "src/**/*.{js,jsx,ts,tsx}"

10 changes: 10 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require("path");

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" --file ")}`;

module.exports = {
"*.{ts,tsx}": [buildEslintCommand, "prettier --write"],
};
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const securityHeaders = [
]

module.exports = {
experimental: {
forceSwcTransforms: true,
},
reactStrictMode: true,
swcMinify: true,
pageExtensions: ['page.tsx', 'page.ts'],
i18n,
async headers() {
Expand Down
Loading

0 comments on commit f563bc6

Please sign in to comment.