generated from JoshuaKGoldberg/create-typescript-app
-
Notifications
You must be signed in to change notification settings - Fork 19
docs: added a 'Project' site section for contributing and maintenance #2306
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ed99535
docs: added a 'Project' site section for contributing and maintenance
JoshuaKGoldberg 17dbaa4
fix some links
JoshuaKGoldberg 99c8579
fix the readme links
JoshuaKGoldberg 66657b4
lil resets
JoshuaKGoldberg b5a103c
one last link fix
JoshuaKGoldberg d3c6819
lil tip fix
JoshuaKGoldberg ccc1587
Apply suggestions from code review
JoshuaKGoldberg f22652c
VS Code-compatible
JoshuaKGoldberg fc98194
mention flint too
JoshuaKGoldberg d0c76b2
More assorted review comments
JoshuaKGoldberg 662e67e
Add contributing-with-ai
JoshuaKGoldberg d08ef3a
Merge branch 'main' into project-docs
JoshuaKGoldberg 47449cf
Merge branch 'main'
JoshuaKGoldberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,131 +1,5 @@ | ||
| # Contributor Covenant Code of Conduct | ||
| # Code of Conduct | ||
|
|
||
| ## Our Pledge | ||
| Thanks for your interest in contributing to `flint`! ❤️🔥 | ||
|
|
||
| We as members, contributors, and leaders pledge to make participation in our | ||
| community a harassment-free experience for everyone, regardless of age, body | ||
| size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
| identity and expression, level of experience, education, socio-economic status, | ||
| nationality, personal appearance, race, caste, color, religion, or sexual | ||
| identity and orientation. | ||
|
|
||
| We pledge to act and interact in ways that contribute to an open, welcoming, | ||
| diverse, inclusive, and healthy community. | ||
|
|
||
| ## Our Standards | ||
|
|
||
| Examples of behavior that contributes to a positive environment for our | ||
| community include: | ||
|
|
||
| - Demonstrating empathy and kindness toward other people | ||
| - Being respectful of differing opinions, viewpoints, and experiences | ||
| - Giving and gracefully accepting constructive feedback | ||
| - Accepting responsibility and apologizing to those affected by our mistakes, | ||
| and learning from the experience | ||
| - Focusing on what is best not just for us as individuals, but for the overall | ||
| community | ||
|
|
||
| Examples of unacceptable behavior include: | ||
|
|
||
| - The use of sexualized language or imagery, and sexual attention or advances of | ||
| any kind | ||
| - Trolling, insulting or derogatory comments, and personal or political attacks | ||
| - Public or private harassment | ||
| - Publishing others' private information, such as a physical or email address, | ||
| without their explicit permission | ||
| - Other conduct which could reasonably be considered inappropriate in a | ||
| professional setting | ||
|
|
||
| ## Enforcement Responsibilities | ||
|
|
||
| Community leaders are responsible for clarifying and enforcing our standards of | ||
| acceptable behavior and will take appropriate and fair corrective action in | ||
| response to any behavior that they deem inappropriate, threatening, offensive, | ||
| or harmful. | ||
|
|
||
| Community leaders have the right and responsibility to remove, edit, or reject | ||
| comments, commits, code, wiki edits, issues, and other contributions that are | ||
| not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
| decisions when appropriate. | ||
|
|
||
| ## Scope | ||
|
|
||
| This Code of Conduct applies within all community spaces, and also applies when | ||
| an individual is officially representing the community in public spaces. | ||
| Examples of representing our community include using an official e-mail address, | ||
| posting via an official social media account, or acting as an appointed | ||
| representative at an online or offline event. | ||
|
|
||
| ## Enforcement | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
| reported to the community leaders responsible for enforcement at | ||
| [email protected]. | ||
| All complaints will be reviewed and investigated promptly and fairly. | ||
|
|
||
| All community leaders are obligated to respect the privacy and security of the | ||
| reporter of any incident. | ||
|
|
||
| ## Enforcement Guidelines | ||
|
|
||
| Community leaders will follow these Community Impact Guidelines in determining | ||
| the consequences for any action they deem in violation of this Code of Conduct: | ||
|
|
||
| ### 1. Correction | ||
|
|
||
| **Community Impact**: Use of inappropriate language or other behavior deemed | ||
| unprofessional or unwelcome in the community. | ||
|
|
||
| **Consequence**: A private, written warning from community leaders, providing | ||
| clarity around the nature of the violation and an explanation of why the | ||
| behavior was inappropriate. | ||
| A public apology may be requested. | ||
|
|
||
| ### 2. Warning | ||
|
|
||
| **Community Impact**: A violation through a single incident or series of | ||
| actions. | ||
|
|
||
| **Consequence**: A warning with consequences for continued behavior. | ||
| No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. | ||
| This includes avoiding interactions in community spaces as well as external channels like social media. | ||
| Violating these terms may lead to a temporary or permanent ban. | ||
|
|
||
| ### 3. Temporary Ban | ||
|
|
||
| **Community Impact**: A serious violation of community standards, including | ||
| sustained inappropriate behavior. | ||
|
|
||
| **Consequence**: A temporary ban from any sort of interaction or public | ||
| communication with the community for a specified period of time. | ||
| No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. | ||
| Violating these terms may lead to a permanent ban. | ||
|
|
||
| ### 4. Permanent Ban | ||
|
|
||
| **Community Impact**: Demonstrating a pattern of violation of community | ||
| standards, including sustained inappropriate behavior, harassment of an | ||
| individual, or aggression toward or disparagement of classes of individuals. | ||
|
|
||
| **Consequence**: A permanent ban from any sort of public interaction within the | ||
| community. | ||
|
|
||
| ## Attribution | ||
|
|
||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
| version 2.1, available at | ||
| [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
|
||
| Community Impact Guidelines were inspired by | ||
| [Mozilla's code of conduct enforcement ladder][mozilla coc]. | ||
|
|
||
| For answers to common questions about this code of conduct, see the FAQ at | ||
| [https://www.contributor-covenant.org/faq][faq]. | ||
| Translations are available at | ||
| [https://www.contributor-covenant.org/translations][translations]. | ||
|
|
||
| [homepage]: https://www.contributor-covenant.org | ||
| [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
| [mozilla coc]: https://github.com/mozilla/diversity | ||
| [faq]: https://www.contributor-covenant.org/faq | ||
| [translations]: https://www.contributor-covenant.org/translations | ||
| See **[flint.fyi/project/code-of-conduct](https://flint.fyi/project/code-of-conduct)** for our code of conduct. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,97 +1,5 @@ | ||
| # Development | ||
|
|
||
| After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation): | ||
| Thanks for your interest in contributing to `flint`! ❤️🔥 | ||
|
|
||
| ```shell | ||
| git clone https://github.com/(your-name-here)/flint | ||
| cd flint | ||
| pnpm install | ||
| ``` | ||
|
|
||
| > This repository includes a list of suggested VS Code extensions. | ||
| > It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development. | ||
|
|
||
| ## Building | ||
|
|
||
| Run TypeScript's builder mode locally to build source files from `src/` into output files in `lib/`: | ||
|
|
||
| ```shell | ||
| pnpm build | ||
| ``` | ||
|
|
||
| Add `--watch` to run the builder in a watch mode that continuously recreates `lib/` as you save files: | ||
|
|
||
| ```shell | ||
| pnpm build --watch | ||
| ``` | ||
|
|
||
| ## Formatting | ||
|
|
||
| [Prettier](https://prettier.io) is used to format code. | ||
| It should be applied automatically when you save files in VS Code or make a Git commit. | ||
|
|
||
| To manually reformat all files, you can run: | ||
|
|
||
| ```shell | ||
| pnpm format --write | ||
| ``` | ||
|
|
||
| ## Linting | ||
|
|
||
| This package includes several forms of linting to enforce consistent code quality and styling. | ||
| Each should be shown in VS Code, and can be run manually on the command-line: | ||
|
|
||
| - `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files | ||
| - `pnpm lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports | ||
| - `pnpm lint:packages` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the `pnpm-lock.yaml` file | ||
|
|
||
| Read the individual documentation for each linter to understand how it can be configured and used best. | ||
|
|
||
| For example, ESLint can be run with `--fix` to auto-fix some lint rule complaints: | ||
|
|
||
| ```shell | ||
| pnpm run lint --fix | ||
| ``` | ||
|
|
||
| Note that you'll need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files. | ||
|
|
||
| ## Testing | ||
|
|
||
| [Vitest](https://vitest.dev) is used for tests. | ||
| You can run it locally on the command-line: | ||
|
|
||
| ```shell | ||
| pnpm run test | ||
| ``` | ||
|
|
||
| Note that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs. | ||
| Calls to `console.log`, `console.warn`, and other console methods will cause a test to fail. | ||
|
|
||
| ### Debugging Tests | ||
|
|
||
| This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests. | ||
| To launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5). | ||
|
|
||
| ## Common Contributing Tasks | ||
|
|
||
| The following sections detail common tasks you may want to perform when contributing to Flint. | ||
|
|
||
| ### Writing a New Rule | ||
|
|
||
| > [!TIP] | ||
| > Search for an existing rule with a similar purpose to see all the places it's referenced. | ||
|
|
||
| To add a new rule, `{ruleName}` to an existing Flint plugin `{plugin}`: | ||
|
|
||
| 1. Create the following files, copying contents from an existing rule as a starting point: | ||
| - `packages/{plugin}/src/rules/{ruleName}.ts` | ||
| - `packages/{plugin}/src/rules/{ruleName}.test.ts` | ||
| - `packages/site/src/content/docs/rules/{plugin}/{ruleName}.mdx` | ||
| 2. Updating existing files that reference rules: | ||
| - `packages/{plugin}/src/plugin.ts`: adding the rule in alphabetical order to `rules` | ||
| - `packages/comparisons/src/data.json`: marking the rule as `"status": "implemented"` | ||
| 3. Try to follow these best practices when writing the rule's documentation and tests: | ||
| - In documentation, see the sections present in other rules and fill them out | ||
| - In _Further Reading_ documentation, find at least one first-party source such as MDN | ||
| - _When Not To Use It_ should not say to always use the rule; instead, think of at least one legitimate reason - even if it's legacy runtimes | ||
| - In tests, use as straightforward code snippets as possible, preferring generic names like `value` over references like `foo`/`bar` | ||
| See **[flint.fyi/project/development](https://flint.fyi/project/development)** for technical steps around how to work on the Flint project codebase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.