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

feat: Add JSON plugin #1

Merged
merged 19 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "\U0001F41E Report a problem"
description: "Report something that isn't working the way you expected."
title: "Bug: (fill in)"
labels:
- bug
- "repro:needed"
body:
- type: markdown
attributes:
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
- type: textarea
attributes:
label: Environment
description: |
Please tell us about how you're running ESLint (Run `npx eslint --env-info`.)
value: |
ESLint version:
@eslint/json version:
Node version:
npm version:
Operating System:
validations:
required: true
- type: dropdown
attributes:
label: Which language are you using?
description: |
Just tell us which language mode you're using.
options:
- json
- jsonc
validations:
required: true
- type: textarea
attributes:
label: What did you do?
description: |
Please include a *minimal* reproduction case.
value: |
<details>
<summary>Configuration</summary>

```
<!-- Paste your configuration here -->
```
</details>

```js
<!-- Paste your code here -->
```
validations:
required: true
- type: textarea
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: What actually happened?
description: |
Please copy-paste the actual ESLint output.
validations:
required: true
- type: input
attributes:
label: Link to Minimal Reproducible Example
description: "Link to a [StackBlitz](https://stackblitz.com), or GitHub repo with a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed."
placeholder: "https://stackblitz.com/abcd1234"
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this issue.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else that's important for the team to know?
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "\U0001F680 Request a change (not rule-related)"
description: "Request a change that is not a bug fix, rule change, or new rule"
title: "Change Request: (fill in)"
labels:
- enhancement
- core
body:
- type: markdown
attributes:
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
- type: textarea
attributes:
label: Environment
description: |
Please tell us about how you're running ESLint (Run `npx eslint --env-info`.)
value: |
ESLint version:
@eslint/json version:
Node version:
npm version:
Operating System:
validations:
required: true
- type: textarea
attributes:
label: What problem do you want to solve?
description: |
Please explain your use case in as much detail as possible.
placeholder: |
The JSON plugin currently...
validations:
required: true
- type: textarea
attributes:
label: What do you think is the correct solution?
description: |
Please explain how you'd like to change the JSON plugin to address the problem.
placeholder: |
I'd like the JSON plugin to...
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this change.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else that's important for the team to know?
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 🗣 Ask a Question, Discuss
url: https://github.com/eslint/json/discussions
about: Get help using this plugin
- name: Discord Server
url: https://eslint.org/chat
about: Talk with the team
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "\U0001F4DD Docs"
description: "Request an improvement to documentation"
title: "Docs: (fill in)"
labels:
- documentation
body:
- type: markdown
attributes:
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
- type: textarea
attributes:
label: Docs page(s)
description: |
What page(s) are you suggesting be changed or created?
placeholder: |
e.g. https://eslint.org/docs/latest/use/getting-started
validations:
required: true
- type: textarea
attributes:
label: What documentation issue do you want to solve?
description: |
Please explain your issue in as much detail as possible.
placeholder: |
The docs currently...
validations:
required: true
- type: textarea
attributes:
label: What do you think is the correct solution?
description: |
Please explain how you'd like to change the docs to address the problem.
placeholder: |
I'd like the docs to...
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this change.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else that's important for the team to know?
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/new-rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "\U0001F680 Propose a new rule"
description: "Propose a new rule to be added to the plugin"
title: "New Rule: (fill in)"
labels:
- rule
- feature
body:
- type: markdown
attributes:
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
- type: input
attributes:
label: Rule details
description: What should the new rule do?
validations:
required: true
- type: dropdown
attributes:
label: What type of rule is this?
options:
- Warns about a potential problem
- Suggests an alternate way of doing something
validations:
required: true
- type: textarea
attributes:
label: Example code
description: Please provide some example code that this rule will warn about. This field will render as JSON.
render: jsonc
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request to implement this rule.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else that's important for the team to know?
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/rule-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "\U0001F4DD Request a rule change"
description: "Request a change to an existing rule"
title: "Rule Change: (fill in)"
labels:
- enhancement
- rule
body:
- type: markdown
attributes:
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
- type: input
attributes:
label: What rule do you want to change?
validations:
required: true
- type: dropdown
attributes:
label: What change do you want to make?
options:
- Generate more warnings
- Generate fewer warnings
- Implement autofix
- Implement suggestions
validations:
required: true
- type: dropdown
attributes:
label: How do you think the change should be implemented?
options:
- A new option
- A new default behavior
- Other
validations:
required: true
- type: textarea
attributes:
label: Example code
description: Please provide some example code that this change will affect. This field will render as JSON.
render: jsonc
validations:
required: true
- type: textarea
attributes:
label: What does the rule currently do for this code?
validations:
required: true
- type: textarea
attributes:
label: What will the rule do after it's changed?
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request to implement this change.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else that's important for the team to know?
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
Thank you for contributing!

ESLint adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
-->

#### Prerequisites checklist

- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/HEAD/CONTRIBUTING.md).

<!--
Please ensure your pull request is ready:

- Read the pull request guide (https://eslint.org/docs/latest/contribute/pull-requests)
- Update or create tests
- If performance-related, include a benchmark
- Update documentation for this change (if appropriate)
-->

<!--
The following is required for all pull requests:
-->

#### What is the purpose of this pull request?

#### What changes did you make? (Give an overview)

#### Related Issues

<!-- include tags like "fixes #123" or "refs #123" -->

#### Is there anything you'd like reviewers to focus on?

<!-- markdownlint-disable-file MD004 -->
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install
- name: Build commonjs
run: npm run build
- name: Lint files
run: npm run lint
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
node: [22.x, 21.x, 20.x, 18.x, "18.18.0"]
include:
- os: windows-latest
node: "lts/*"
- os: macOS-latest
node: "lts/*"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
Loading