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

v7 #915

Merged
merged 27 commits into from
Mar 4, 2024
Merged

v7 #915

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eb90bc3
Add eslint-plugin-security for Node environments (#898)
hilleer Nov 10, 2023
d937ac3
Add changeset for eslint-plugin-security
connor-baer Nov 10, 2023
0fc1379
Enter prerelease mode
connor-baer Nov 10, 2023
f392d28
Upgrade all dependencies (#910)
connor-baer Dec 1, 2023
9e9d2c2
Add Storybook's ESLint plugin (#911)
connor-baer Dec 1, 2023
638b4ed
Version Packages (next) (#904)
connor-baer Dec 1, 2023
7d49597
Switch from Jest to Vitest (#913)
connor-baer Dec 1, 2023
df2477b
Upgrade to Prettier v3 (#912)
connor-baer Dec 1, 2023
20f9314
Version Packages (next) (#914)
connor-baer Dec 1, 2023
c721ad6
Remove /coverage dir
connor-baer Dec 1, 2023
ea7c264
Remove framework plugins from dependencies (#923)
connor-baer Jan 23, 2024
13bec0b
Version Packages (next) (#924)
connor-baer Jan 23, 2024
d6da327
Upgrade all dependencies (#925)
connor-baer Jan 23, 2024
d8fdc57
Merge branch 'main' into next
connor-baer Jan 24, 2024
7a39c58
Upgrade to Stylelint 16 (#926)
connor-baer Jan 24, 2024
eb43166
Disable security/detect-object-injection rule (#928)
connor-baer Jan 24, 2024
20d1be5
Add support for Circuit UI's ESLint plugin (#929)
connor-baer Jan 24, 2024
957f1da
Document the new config detection logic (#930)
connor-baer Jan 24, 2024
39b28a8
Add more info to debug command (#931)
connor-baer Jan 24, 2024
09a7d13
Version Packages (next) (#927)
connor-baer Jan 24, 2024
85b5fbe
Fix e2e test plugin scope to better support monorepos (#932)
connor-baer Jan 26, 2024
aa6f69e
Version Packages (next) (#933)
connor-baer Jan 26, 2024
1f3067e
Make package version parsing more robust (#934)
connor-baer Jan 29, 2024
72e13e7
Version Packages (next) (#935)
connor-baer Jan 29, 2024
6e43585
Upgrade stylelint-config-recess-order to v5 (#948)
connor-baer Mar 4, 2024
09c89fe
Exit prerelease mode
connor-baer Mar 4, 2024
393e5b3
Merge branch 'main' into next
connor-baer Mar 4, 2024
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
5 changes: 5 additions & 0 deletions .changeset/empty-eagles-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Added support for [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook). This plugin helps conform to [Storybook](https://storybook.js.org/)'s best practices.
5 changes: 5 additions & 0 deletions .changeset/four-crews-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": major
---

Upgraded to [Stylelint 16](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md#1600). Refer to the [migration guide](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-16.md).
5 changes: 5 additions & 0 deletions .changeset/fresh-hounds-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Upgraded to Prettier v3. [Read the release announcement](https://prettier.io/blog/2023/07/05/3.0.0.html).
5 changes: 5 additions & 0 deletions .changeset/fuzzy-bees-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Upgraded `@typescript-eslint/typescript-eslint` to v6. Read the [changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/CHANGELOG.md).
5 changes: 5 additions & 0 deletions .changeset/green-wasps-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": minor
---

Expanded the scope of the Cypress and Playwright plugins to account for end-to-end test in subdirectories.
5 changes: 5 additions & 0 deletions .changeset/little-pants-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Upgraded `eslint-plugin-testing-library` to v6. Read the [migration guide](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/migration-guides/v6.md).
5 changes: 5 additions & 0 deletions .changeset/nervous-dolphins-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": minor
---

Added a new `debug` command to inspect the detected configuration options.
5 changes: 5 additions & 0 deletions .changeset/plenty-needles-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Removed the ESLint plugins for [Cypress](https://www.npmjs.com/package/eslint-plugin-cypress), [Emotion](https://www.npmjs.com/package/@emotion/eslint-plugin), [Jest](https://www.npmjs.com/package/eslint-plugin-jest), [Next.js](https://www.npmjs.com/package/eslint-config-next), [Playwright](https://www.npmjs.com/package/eslint-plugin-playwright), [Storybook](https://www.npmjs.com/package/eslint-plugin-storybook), and [Testing Library](https://www.npmjs.com/package/eslint-plugin-testing-library) from the dependencies. Install the plugins as dev dependencies in your project. Foundry still enables and configures them automatically.
22 changes: 22 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"mode": "exit",
"tag": "next",
"initialVersions": {
"@sumup/foundry": "6.1.0"
},
"changesets": [
"empty-eagles-rule",
"four-crews-admire",
"fresh-hounds-pretend",
"fuzzy-bees-build",
"green-wasps-repeat",
"little-pants-attend",
"nervous-dolphins-fix",
"plenty-needles-hunt",
"silly-seals-arrive",
"twelve-pandas-listen",
"twenty-comics-laugh",
"warm-apples-greet",
"wicked-trees-join"
]
}
5 changes: 5 additions & 0 deletions .changeset/silly-seals-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": minor
---

Removed the obsolete `publish` option which hasn't been used since v6.
5 changes: 5 additions & 0 deletions .changeset/twelve-pandas-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': minor
---

Added support for [`@sumup/eslint-plugin-circuit-ui`](https://circuit.sumup.com/?path=/docs/packages-eslint-plugin-circuit-ui--docs). This plugin helps users follow best practices when using [Circuit UI](https://circuit.sumup.com/).
5 changes: 5 additions & 0 deletions .changeset/twenty-comics-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": patch
---

Improved package version detection to handle tarball URLs and fail gracefully.
5 changes: 5 additions & 0 deletions .changeset/warm-apples-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Added [`eslint-plugin-security`](https://github.com/eslint-community/eslint-plugin-security) for Node environments. This plugin helps identify potential security hotspots, but finds a lot of false positives which need triage by a human.
5 changes: 5 additions & 0 deletions .changeset/wicked-trees-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/foundry': major
---

Raised the minimum Node version to ^18.12 || >=20 (i.e. Node 19 is not supported).
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18]
node: [18, 20]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist
public
jest-test-results.json
junit.xml
coverage
__coverage__
__reports__
.npm
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/iron
44 changes: 18 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,18 @@ A toolkit that makes it a breeze to set up and maintain JavaScript + TypeScript

### Installation

Foundry needs to be installed as a dev-dependency via the [npm](https://www.npmjs.com) or [Yarn](https://classic.yarnpkg.com) package managers. The npm CLI ships with [Node](https://nodejs.org/en/). You can read how to install the Yarn CLI in [their documentation](https://classic.yarnpkg.com/en/docs/install). Foundry requires Node `^14.17 || >=16`.

Depending on your preference, run one of the following.
Foundry should be installed as a dev-dependency. Run the following command in your terminal:

```sh
# With npm
$ npm install --save-dev @sumup/foundry

# With Yarn v1
$ yarn add --dev @sumup/foundry
npm install --save-dev @sumup/foundry
```

### Initialization

Foundry exposes customizable configurations for the CLI tools it supports. Use the `init` command to initialize a configuration file for the tools you would like to use:

```sh
# With npm
$ npx foundry init

# With Yarn v1
$ yarn run foundry init
npx foundry init
```

Foundry will launch an interactive prompt to ask you questions about your project, such as whether you are planning to open source it. Once you have answered all questions, Foundry will write the config files (don't worry, it asks before overwriting existing files) and will add scripts to your `package.json` file to conveniently run the tools.
Expand All @@ -54,7 +44,6 @@ Alternatively, you can pass your answers to the `init` command directly as flags

```sh
-o, --openSource Whether the project is open-source [boolean]
--publish Whether to publish to NPM [boolean]
-c, --configDir The directory to write configs to [string] [default: "."]
--overwrite Whether to overwrite existing config files
[boolean] [default: false]
Expand All @@ -79,7 +68,13 @@ module.exports = require('@sumup/foundry/eslint')({

The overrides are merged with Foundry's default configuration. The overrides follow each tool's configuration schema, please refer to their official documentation.

Foundry analyzes your project's `package.json` file to tailor the configurations to your project. If the automatic detection is inaccurate, [please open an issue](https://github.com/sumup-oss/foundry/issues/new/choose) so we can improve it for everyone. Alternatively, you can explicitly set the options under the `foundry` property in your `package.json` file:
Foundry analyzes your project's dependencies to tailor the configurations to your project. It detects which ESLint plugins are installed and enables & configures them automatically. Foundry will warn you if a framework is installed but not its corresponding ESLint plugin or if a version of a plugin is installed hasn't been tested with Foundry. Use the `debug` command to inspect the detected configuration:

```sh
npx foundry debug
```

If the automatic detection is inaccurate, [please open an issue](https://github.com/sumup-oss/foundry/issues/new/choose) so we can improve it for everyone. Alternatively, you can explicitly set the options under the `foundry` property in your `package.json` file:

```json
// package.json
Expand All @@ -92,12 +87,13 @@ Foundry analyzes your project's `package.json` file to tailor the configurations

The supported options are:

| Name | Type | Options | Default |
| ------------ | ------- | --------------------------------------------------------------------------------- | -------------- |
| language | string | 'TypeScript', 'JavaScript' | _autodetected_ |
| environments | array | 'Browser', 'Node' | _autodetected_ |
| frameworks | array | 'React', 'Next.js', 'Emotion', 'Jest', 'Testing Library', 'Cypress', 'Playwright' | _autodetected_ |
| openSource | boolean | true, false | _autodetected_ |
| Name | Type | Options |
| ------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| language | string | 'TypeScript', 'JavaScript' |
| environments | array | 'Browser', 'Node' |
| plugins | array | ['Circuit UI'](https://www.npmjs.com/package/@sumup/eslint-plugin-circuit-ui), ['Cypress'](https://www.npmjs.com/package/eslint-plugin-cypress), ['Emotion'](https://www.npmjs.com/package/@emotion/eslint-plugin), ['Jest'](https://www.npmjs.com/package/eslint-plugin-jest), ['Next.js'](https://www.npmjs.com/package/eslint-config-next), ['Playwright'](https://www.npmjs.com/package/eslint-plugin-playwright), ['Storybook'](https://www.npmjs.com/package/eslint-plugin-storybook), ['Testing Library'](https://www.npmjs.com/package/eslint-plugin-testing-library) |
| frameworks | array | 'Next.js', 'React' |
| openSource | boolean | true, false |

## Lint preset

Expand All @@ -119,11 +115,7 @@ The preset includes the following tools:
Foundry manages all supported tools for you and exposes them via the `run` command. As an example, to run ESLint through Foundry, execute:

```sh
# With npm
$ npx foundry run eslint src

# With Yarn v1
$ yarn foundry run eslint src
npx foundry run eslint src
```

Here, `src` is the folder you want ESLint to check. Note that you can use any of the command-line flags and arguments supported by ESLint and other tools. Foundry forwards them so they get handled by the tool. For example, to have ESLint fix your linting errors, run `npx foundry run eslint --fix src`.
Expand Down
Loading
Loading