Skip to content

Commit 64b8e61

Browse files
authored
Switch to v2 (#948)
1 parent 2966b9c commit 64b8e61

File tree

640 files changed

+68559
-97014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+68559
-97014
lines changed

.eslintrc.cjs

+33-50
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,53 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
const { readdirSync, existsSync } = require("fs");
16-
const { join } = require("path");
17-
1815
module.exports = {
1916
env: {
2017
browser: true,
2118
es2021: true,
2219
node: true,
2320
},
24-
ignorePatterns: [
25-
"packages/typescript-compat/*/dist/**",
26-
"packages/*/dist/**",
27-
"packages/*/.tmp/**",
28-
"node_modules/**",
29-
],
21+
root: true,
22+
ignorePatterns: ["packages/*/dist/**"],
3023
plugins: ["@typescript-eslint", "n", "import"],
3124
// Rules and settings that do not require a non-default parser
3225
extends: ["eslint:recommended"],
3326
rules: {
3427
"no-console": "error",
35-
"import/no-duplicates": "off",
28+
"import/no-cycle": "error",
29+
"import/no-duplicates": "error",
3630
},
37-
settings: {},
3831
overrides: [
39-
...readdirSync("packages", { withFileTypes: true })
40-
.filter((entry) => entry.isDirectory())
41-
.map((entry) => join("packages", entry.name))
42-
.filter((dir) => existsSync(join(dir, "tsconfig.json")))
43-
.map((dir) => {
44-
return {
45-
files: [join(dir, "src/**/*.ts")],
46-
parser: "@typescript-eslint/parser",
47-
parserOptions: {
48-
project: "./tsconfig.json",
49-
tsconfigRootDir: dir,
50-
},
51-
settings: {
52-
"import/resolver": {
53-
typescript: {
54-
project: "packages/*/tsconfig.json",
55-
},
56-
},
57-
},
58-
extends: [
59-
"plugin:@typescript-eslint/recommended",
60-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
61-
"plugin:import/recommended",
62-
"plugin:import/typescript",
63-
],
64-
rules: {
65-
"@typescript-eslint/strict-boolean-expressions": "error",
66-
"@typescript-eslint/no-unnecessary-condition": "error",
67-
"@typescript-eslint/array-type": "off", // we use complex typings, where Array is actually more readable than T[]
68-
"@typescript-eslint/switch-exhaustiveness-check": "error",
69-
"@typescript-eslint/prefer-nullish-coalescing": "error",
70-
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
71-
"error",
72-
"@typescript-eslint/no-invalid-void-type": "error",
73-
"@typescript-eslint/no-base-to-string": "error",
74-
"import/no-cycle": "error",
75-
"import/no-duplicates": "off",
32+
{
33+
files: ["**/*.{ts,tsx,cts,mts}"],
34+
parser: "@typescript-eslint/parser",
35+
parserOptions: {
36+
project: true,
37+
},
38+
settings: {
39+
"import/resolver": {
40+
typescript: {
41+
project: "tsconfig.json",
7642
},
77-
};
78-
}),
43+
},
44+
},
45+
extends: [
46+
"plugin:@typescript-eslint/recommended",
47+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
48+
"plugin:import/recommended",
49+
"plugin:import/typescript",
50+
],
51+
rules: {
52+
"@typescript-eslint/strict-boolean-expressions": "error",
53+
"@typescript-eslint/no-unnecessary-condition": "error",
54+
"@typescript-eslint/array-type": "off", // we use complex typings, where Array is actually more readable than T[]
55+
"@typescript-eslint/switch-exhaustiveness-check": "error",
56+
"@typescript-eslint/prefer-nullish-coalescing": "error",
57+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
58+
"@typescript-eslint/no-invalid-void-type": "error",
59+
"@typescript-eslint/no-base-to-string": "error",
60+
},
61+
},
7962
// For scripts and configurations, use Node.js rules
8063
{
8164
files: ["**/*.{js,mjs,cjs}"],

.github/CODE_OF_CONDUCT.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within
@@ -118,16 +118,15 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119119
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
120120

121-
Community Impact Guidelines were inspired by
121+
Community Impact Guidelines were inspired by
122122
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123123

124124
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126126
at [https://www.contributor-covenant.org/translations][translations].
127127

128128
[homepage]: https://www.contributor-covenant.org
129129
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
130130
[Mozilla CoC]: https://github.com/mozilla/diversity
131131
[FAQ]: https://www.contributor-covenant.org/faq
132132
[translations]: https://www.contributor-covenant.org/translations
133-

.github/CONTRIBUTING.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Contributing
2-
============
1+
# Contributing
32

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

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

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

29+
```bash
30+
npm ci
3031
```
31-
make
32+
33+
Make sure that the tests and the linters pass:
34+
35+
```bash
36+
npx turbo run test lint
3237
```
3338

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

3542
## Making Changes
3643

@@ -43,7 +50,7 @@ git rebase upstream/main
4350
git checkout -b cool_new_feature
4451
```
4552

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

4956
```
@@ -53,19 +60,18 @@ git push origin cool_new_feature
5360

5461
Then use the GitHub UI to open a pull request.
5562

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

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

63-
* Add tests for new functionality.
64-
* Write a [good commit message][commit-message].
65-
* Maintain backward compatibility.
70+
- Add tests for new functionality.
71+
- Write a [good commit message][commit-message].
72+
- Maintain backward compatibility.
6673

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

0 commit comments

Comments
 (0)