Skip to content

Commit 52d4f2c

Browse files
nzakasmdjermanovic
andauthored
feat: CSS language plugin (#2)
* feat: CSS language plugin * Fix lint error * Fix style errors * Add error handling * Fix formatting * Update .github/ISSUE_TEMPLATE/config.yml Co-authored-by: Milos Djermanovic <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Milos Djermanovic <[email protected]> * Update src/index.js Co-authored-by: Milos Djermanovic <[email protected]> * Update src/languages/css-source-code.js Co-authored-by: Milos Djermanovic <[email protected]> * Update src/languages/css-language.js Co-authored-by: Milos Djermanovic <[email protected]> * Update README.md Co-authored-by: Milos Djermanovic <[email protected]> * Update README.md Co-authored-by: Milos Djermanovic <[email protected]> * Remove methods for extending Block location and upgrade css-tree * Fix lint error * Remove Node 21.x from CI * Catch multiple syntax errors * Fix file formatting * Ensure README.md is formatting after rules are updated * Update tests/rules/no-empty-blocks.test.js Co-authored-by: Milos Djermanovic <[email protected]> * Update src/languages/css-visitor-keys.js Co-authored-by: Milos Djermanovic <[email protected]> * Update tests/languages/css-language.test.js Co-authored-by: Milos Djermanovic <[email protected]> * Disable prettier for code block on README * Update tests/languages/css-source-code.test.js Co-authored-by: Milos Djermanovic <[email protected]> * Update tests/languages/css-source-code.test.js Co-authored-by: Milos Djermanovic <[email protected]> * Update tests/languages/css-source-code.test.js Co-authored-by: Milos Djermanovic <[email protected]> --------- Co-authored-by: Milos Djermanovic <[email protected]>
1 parent 17ffdad commit 52d4f2c

Some content is hidden

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

41 files changed

+2765
-2
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Convert text file line endings to lf
2+
* text=auto
3+
4+
*.js text eol=lf

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: "\U0001F41E Report a problem"
2+
description: "Report something that isn't working the way you expected."
3+
title: "Bug: (fill in)"
4+
labels:
5+
- bug
6+
- "repro:needed"
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
11+
- type: textarea
12+
attributes:
13+
label: Environment
14+
description: |
15+
Please tell us about how you're running ESLint (Run `npx eslint --env-info`.)
16+
value: |
17+
ESLint version:
18+
@eslint/css version:
19+
Node version:
20+
npm version:
21+
Operating System:
22+
validations:
23+
required: true
24+
- type: dropdown
25+
attributes:
26+
label: Which language are you using?
27+
description: |
28+
Just tell us which language mode you're using.
29+
options:
30+
- stylesheet
31+
- rule
32+
validations:
33+
required: true
34+
- type: textarea
35+
attributes:
36+
label: What did you do?
37+
description: |
38+
Please include a *minimal* reproduction case.
39+
value: |
40+
<details>
41+
<summary>Configuration</summary>
42+
43+
```
44+
<!-- Paste your configuration here -->
45+
```
46+
</details>
47+
48+
```js
49+
<!-- Paste your code here -->
50+
```
51+
validations:
52+
required: true
53+
- type: textarea
54+
attributes:
55+
label: What did you expect to happen?
56+
validations:
57+
required: true
58+
- type: textarea
59+
attributes:
60+
label: What actually happened?
61+
description: |
62+
Please copy-paste the actual ESLint output.
63+
validations:
64+
required: true
65+
- type: input
66+
attributes:
67+
label: Link to Minimal Reproducible Example
68+
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."
69+
placeholder: "https://stackblitz.com/abcd1234"
70+
validations:
71+
required: true
72+
- type: checkboxes
73+
attributes:
74+
label: Participation
75+
options:
76+
- label: I am willing to submit a pull request for this issue.
77+
required: false
78+
- type: textarea
79+
attributes:
80+
label: Additional comments
81+
description: Is there anything else that's important for the team to know?

.github/ISSUE_TEMPLATE/change.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "\U0001F680 Request a change (not rule-related)"
2+
description: "Request a change that is not a bug fix, rule change, or new rule"
3+
title: "Change Request: (fill in)"
4+
labels:
5+
- enhancement
6+
- core
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
11+
- type: textarea
12+
attributes:
13+
label: Environment
14+
description: |
15+
Please tell us about how you're running ESLint (Run `npx eslint --env-info`.)
16+
value: |
17+
ESLint version:
18+
@eslint/css version:
19+
Node version:
20+
npm version:
21+
Operating System:
22+
validations:
23+
required: true
24+
- type: textarea
25+
attributes:
26+
label: What problem do you want to solve?
27+
description: |
28+
Please explain your use case in as much detail as possible.
29+
placeholder: |
30+
The CSS plugin currently...
31+
validations:
32+
required: true
33+
- type: textarea
34+
attributes:
35+
label: What do you think is the correct solution?
36+
description: |
37+
Please explain how you'd like to change the CSS plugin to address the problem.
38+
placeholder: |
39+
I'd like the CSS plugin to...
40+
validations:
41+
required: true
42+
- type: checkboxes
43+
attributes:
44+
label: Participation
45+
options:
46+
- label: I am willing to submit a pull request for this change.
47+
required: false
48+
- type: textarea
49+
attributes:
50+
label: Additional comments
51+
description: Is there anything else that's important for the team to know?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 🗣 Ask a Question, Discuss
4+
url: https://github.com/eslint/css/discussions
5+
about: Get help using this plugin
6+
- name: Discord Server
7+
url: https://eslint.org/chat
8+
about: Talk with the team

.github/ISSUE_TEMPLATE/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "\U0001F4DD Docs"
2+
description: "Request an improvement to documentation"
3+
title: "Docs: (fill in)"
4+
labels:
5+
- documentation
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
10+
- type: textarea
11+
attributes:
12+
label: Docs page(s)
13+
description: |
14+
What page(s) are you suggesting be changed or created?
15+
placeholder: |
16+
e.g. https://eslint.org/docs/latest/use/getting-started
17+
validations:
18+
required: true
19+
- type: textarea
20+
attributes:
21+
label: What documentation issue do you want to solve?
22+
description: |
23+
Please explain your issue in as much detail as possible.
24+
placeholder: |
25+
The docs currently...
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: What do you think is the correct solution?
31+
description: |
32+
Please explain how you'd like to change the docs to address the problem.
33+
placeholder: |
34+
I'd like the docs to...
35+
validations:
36+
required: true
37+
- type: checkboxes
38+
attributes:
39+
label: Participation
40+
options:
41+
- label: I am willing to submit a pull request for this change.
42+
required: false
43+
- type: textarea
44+
attributes:
45+
label: Additional comments
46+
description: Is there anything else that's important for the team to know?

.github/ISSUE_TEMPLATE/new-rule.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "\U0001F680 Propose a new rule"
2+
description: "Propose a new rule to be added to the plugin"
3+
title: "New Rule: (fill in)"
4+
labels:
5+
- rule
6+
- feature
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
11+
- type: input
12+
attributes:
13+
label: Rule details
14+
description: What should the new rule do?
15+
validations:
16+
required: true
17+
- type: dropdown
18+
attributes:
19+
label: What type of rule is this?
20+
options:
21+
- Warns about a potential problem
22+
- Suggests an alternate way of doing something
23+
validations:
24+
required: true
25+
- type: textarea
26+
attributes:
27+
label: Example code
28+
description: Please provide some example code that this rule will warn about. This field will render as CSS.
29+
render: css
30+
validations:
31+
required: true
32+
- type: checkboxes
33+
attributes:
34+
label: Participation
35+
options:
36+
- label: I am willing to submit a pull request to implement this rule.
37+
required: false
38+
- type: textarea
39+
attributes:
40+
label: Additional comments
41+
description: Is there anything else that's important for the team to know?
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "\U0001F4DD Request a rule change"
2+
description: "Request a change to an existing rule"
3+
title: "Rule Change: (fill in)"
4+
labels:
5+
- enhancement
6+
- rule
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: By opening an issue, you agree to abide by the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
11+
- type: input
12+
attributes:
13+
label: What rule do you want to change?
14+
validations:
15+
required: true
16+
- type: dropdown
17+
attributes:
18+
label: What change do you want to make?
19+
options:
20+
- Generate more warnings
21+
- Generate fewer warnings
22+
- Implement autofix
23+
- Implement suggestions
24+
validations:
25+
required: true
26+
- type: dropdown
27+
attributes:
28+
label: How do you think the change should be implemented?
29+
options:
30+
- A new option
31+
- A new default behavior
32+
- Other
33+
validations:
34+
required: true
35+
- type: textarea
36+
attributes:
37+
label: Example code
38+
description: Please provide some example code that this change will affect. This field will render as CSS.
39+
render: css
40+
validations:
41+
required: true
42+
- type: textarea
43+
attributes:
44+
label: What does the rule currently do for this code?
45+
validations:
46+
required: true
47+
- type: textarea
48+
attributes:
49+
label: What will the rule do after it's changed?
50+
validations:
51+
required: true
52+
- type: checkboxes
53+
attributes:
54+
label: Participation
55+
options:
56+
- label: I am willing to submit a pull request to implement this change.
57+
required: false
58+
- type: textarea
59+
attributes:
60+
label: Additional comments
61+
description: Is there anything else that's important for the team to know?

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
Thank you for contributing!
3+
4+
ESLint adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
5+
-->
6+
7+
#### Prerequisites checklist
8+
9+
- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/HEAD/CONTRIBUTING.md).
10+
11+
<!--
12+
Please ensure your pull request is ready:
13+
14+
- Read the pull request guide (https://eslint.org/docs/latest/contribute/pull-requests)
15+
- Update or create tests
16+
- If performance-related, include a benchmark
17+
- Update documentation for this change (if appropriate)
18+
-->
19+
20+
<!--
21+
The following is required for all pull requests:
22+
-->
23+
24+
#### What is the purpose of this pull request?
25+
26+
#### What changes did you make? (Give an overview)
27+
28+
#### Related Issues
29+
30+
<!-- include tags like "fixes #123" or "refs #123" -->
31+
32+
#### Is there anything you'd like reviewers to focus on?
33+
34+
<!-- markdownlint-disable-file MD004 -->

.github/workflows/bun-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bun CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os: [windows-latest, macOS-latest, ubuntu-latest]
18+
bun: [latest]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Bun ${{ matrix.bun }} ${{ matrix.os }}
23+
uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: ${{ matrix.bun }}
26+
- name: bun install, build, and test
27+
run: |
28+
bun install
29+
bun run --bun test
30+
env:
31+
CI: true

0 commit comments

Comments
 (0)