Skip to content

Commit

Permalink
feat: improve lint tools (#256)
Browse files Browse the repository at this point in the history
* chore: setup linter and formater tools

fix: add formater to all known files

fix: linter and formatter fixes with some ignored rules

fix: linter fixes

fix: change way to detect tsconfig files

fix: update linter settings

fix: use single qoute always and semicolon just when it's necessary

* fix: add sort imports (#279)

* feat: add support for import sorting plugin

- added import sorting plugin
- also converted from .js file to .json file so typescript compiler
and eslint doesn't complain about commonjs module syntax

* fix: converted all .eslintrc.js to .eslintrc.json

and only use one "root" config so everything is shared

* fix: sort imports lint fix

* fix: import extension error to be disabled in shared elsint config

---------

Co-authored-by: Micah Thomas <95306190+bc-micah@users.noreply.github.com>
  • Loading branch information
2 people authored and kris-liu-smile committed Apr 23, 2023
1 parent ac72444 commit 49c18ab
Show file tree
Hide file tree
Showing 348 changed files with 14,652 additions and 17,449 deletions.
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.js

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"root": true,
"extends": ["b2b"],
"settings": {
"import/resolver": {
"typescript": {
"project": ["packages/*/tsconfig.json", "apps/*/tsconfig.json"]
}
}
},
"parserOptions": {
"project": ["packages/*/tsconfig.json", "apps/*/tsconfig.json"]
}
}
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
## What?

Write a description of the changes you're making here, and decisions that you made
along the way. Provide enough context that the reviewer(s) can understand your
changes, and the intent behind them. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#what)

## Why?

Describe the underlying driver or intent behind this change. Provide some context
on why it's needed or what is the intended use. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#why)

## Testing / Proof

Explain what you did to test and ensure that these changes work the way you expect.
You must provide evidence in the form of unit tests, screenshots, logs, API
payloads or other output to show the expected behaviour. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#testing--proof)

## How can this change be undone in case of failure?

Provide experiments, feature flags or other mechanisms which used to reduce the risk of changes introduced in this PR. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#how-can-this-change-be-undone-in-case-of-failure)

ping {suggested reviewers}
1 change: 0 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- dev
- main


jobs:
test:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/dist
**/out
**/build
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package

## Apps and Packages

- `/apps/storefront`: the new BundleB2B storefront aplication, [React 18](https://reactjs.org/) app using [vite](http://vitejs.dev/) as the building tool.
- `/apps/storefront`: the new BundleB2B storefront aplication, [React 18](https://reactjs.org/) app using [vite](http://vitejs.dev/) as the building tool.

- `/packages/eslint-config-b3`: the shared eslint config.

Expand All @@ -26,6 +26,7 @@ This turborepo has the tools and packages already setup:
- [React Router 6](https://reactrouter.com/) as the frontend router.

## Setup

1. Run `yarn install`
2. Copy `apps/storefront/.env-example` and paste it as `.env`
3. Update the `VITE_STORE_HASH` value on `.env` file
Expand Down
17 changes: 17 additions & 0 deletions apps/storefront/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["b2b"],
"rules": {
// TODO: make a soft update removing one by one
"import/no-cycle": 0,
"react-hooks/exhaustive-deps": 0,
"react/jsx-props-no-spreading": 0,
"@typescript-eslint/no-shadow": 0,
"no-param-reassign": 0,
"@typescript-eslint/no-explicit-any": 0,
"no-console": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/no-namespace": 0,
"react/destructuring-assignment": 0,
"@typescript-eslint/no-non-null-assertion": 0
}
}
Loading

0 comments on commit 49c18ab

Please sign in to comment.