Skip to content

Commit

Permalink
Switch to v2 (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm authored Jul 30, 2024
1 parent 2966b9c commit 64b8e61
Show file tree
Hide file tree
Showing 640 changed files with 68,559 additions and 97,014 deletions.
83 changes: 33 additions & 50 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,53 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const { readdirSync, existsSync } = require("fs");
const { join } = require("path");

module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
ignorePatterns: [
"packages/typescript-compat/*/dist/**",
"packages/*/dist/**",
"packages/*/.tmp/**",
"node_modules/**",
],
root: true,
ignorePatterns: ["packages/*/dist/**"],
plugins: ["@typescript-eslint", "n", "import"],
// Rules and settings that do not require a non-default parser
extends: ["eslint:recommended"],
rules: {
"no-console": "error",
"import/no-duplicates": "off",
"import/no-cycle": "error",
"import/no-duplicates": "error",
},
settings: {},
overrides: [
...readdirSync("packages", { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => join("packages", entry.name))
.filter((dir) => existsSync(join(dir, "tsconfig.json")))
.map((dir) => {
return {
files: [join(dir, "src/**/*.ts")],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: dir,
},
settings: {
"import/resolver": {
typescript: {
project: "packages/*/tsconfig.json",
},
},
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
],
rules: {
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/array-type": "off", // we use complex typings, where Array is actually more readable than T[]
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
"error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-base-to-string": "error",
"import/no-cycle": "error",
"import/no-duplicates": "off",
{
files: ["**/*.{ts,tsx,cts,mts}"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
settings: {
"import/resolver": {
typescript: {
project: "tsconfig.json",
},
};
}),
},
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
],
rules: {
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/array-type": "off", // we use complex typings, where Array is actually more readable than T[]
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-base-to-string": "error",
},
},
// For scripts and configurations, use Node.js rules
{
files: ["**/*.{js,mjs,cjs}"],
Expand Down
27 changes: 13 additions & 14 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
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,
- 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
- 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
- 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
- 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
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ 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
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
Expand All @@ -118,16 +118,15 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by
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
[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.0]: https://www.contributor-covenant.org/version/2/0/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

28 changes: 17 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Contributing
============
# Contributing

We'd love your help making `protobuf-es` better!

Expand All @@ -24,13 +23,21 @@ git remote add upstream https://github.com/bufbuild/protobuf-es.git
git fetch upstream
```

Make sure that the tests and the linters pass (you'll need Node.js in the
version specified in .nvmrc, `bash`, and `make`):
Install dependencies (you'll need Node.js in the version specified in `.nvmrc`,
and `npm` in the version specified in `package.json`):

```bash
npm ci
```
make

Make sure that the tests and the linters pass:

```bash
npx turbo run test lint
```

We're using `turborepo` to run tasks. If you haven't used it yet, take a look at
[filtering and package scoping](https://turbo.build/repo/docs/crafting-your-repository/running-tasks).

## Making Changes

Expand All @@ -43,7 +50,7 @@ git rebase upstream/main
git checkout -b cool_new_feature
```

Make your changes, then ensure that `make` still passes.
Make your changes, then ensure that tests and linters still pass.
When you're satisfied with your changes, push them to your fork.

```
Expand All @@ -53,19 +60,18 @@ git push origin cool_new_feature

Then use the GitHub UI to open a pull request.

At this point, you're waiting on us to review your changes. We *try* to respond
At this point, you're waiting on us to review your changes. We _try_ to respond
to issues and pull requests within a few business days, and we may suggest some
improvements or alternatives. Once your changes are approved, one of the
project maintainers will merge them.

We're much more likely to approve your changes if you:

* Add tests for new functionality.
* Write a [good commit message][commit-message].
* Maintain backward compatibility.
- Add tests for new functionality.
- Write a [good commit message][commit-message].
- Maintain backward compatibility.

[fork]: https://github.com/bufbuild/protobuf-es/fork
[open-issue]: https://github.com/bufbuild/protobuf-es/issues/new
[cla]: https://cla-assistant.io/bufbuild/protobuf-es
[commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

Loading

0 comments on commit 64b8e61

Please sign in to comment.