Skip to content

Commit 77b6d3f

Browse files
authored
chore: migrate lint setup to Oxlint and Oxfmt (#4)
1 parent 14e7683 commit 77b6d3f

19 files changed

+294
-345
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ jobs:
8080
- name: 🚀 Publish to Open VSX
8181
run: bun ovsx publish ./vscode-react-native-directory.vsix
8282
env:
83-
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}
83+
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464
env:
6565
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
6666
GIT_AUTHOR_NAME: '[bot] Release Agent'
67-
GIT_COMMITTER_NAME: '[bot] Release Agent'
67+
GIT_COMMITTER_NAME: '[bot] Release Agent'

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
run: bun install
2828

2929
- name: ✅ Lint project
30-
run: bun lint
30+
run: bun lint

.oxfmtrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 120,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"bracketSameLine": true,
7+
"trailingComma": "es5",
8+
"arrowParens": "avoid",
9+
"ignorePatterns": ["**/build", "**/node_modules", "package.json", "CHANGELOG.md"]
10+
}

.oxlintrc.json

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["import", "promise", "typescript", "unicorn"],
4+
"ignorePatterns": ["**/build", "**/node_modules"],
5+
"rules": {
6+
"curly": "error",
7+
"eqeqeq": [
8+
"error",
9+
"always",
10+
{
11+
"null": "ignore"
12+
}
13+
],
14+
"func-style": ["error", "declaration"],
15+
"no-unused-expressions": [
16+
"error",
17+
{
18+
"allowShortCircuit": true,
19+
"enforceForJSX": true
20+
}
21+
],
22+
"no-unused-vars": [
23+
"error",
24+
{
25+
"vars": "all",
26+
"args": "none",
27+
"ignoreRestSiblings": true,
28+
"caughtErrors": "all",
29+
"caughtErrorsIgnorePattern": "^_"
30+
}
31+
],
32+
"no-useless-computed-key": "error",
33+
"no-useless-concat": "error",
34+
"no-useless-constructor": "error",
35+
"no-useless-return": "error",
36+
"no-void": [
37+
"error",
38+
{
39+
"allowAsStatement": true
40+
}
41+
],
42+
"prefer-promise-reject-errors": "error",
43+
"prefer-rest-params": "error",
44+
"prefer-spread": "error",
45+
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
46+
"import/default": "error",
47+
"import/namespace": "error",
48+
"import/no-cycle": [
49+
"error",
50+
{
51+
"maxDepth": 3,
52+
"disableScc": true
53+
}
54+
],
55+
"import/no-duplicates": "error",
56+
"import/no-named-as-default": "error",
57+
"import/no-named-as-default-member": "error",
58+
"import/no-self-import": "error",
59+
"promise/always-return": "error",
60+
"promise/no-callback-in-promise": "error",
61+
"typescript/await-thenable": "error",
62+
"typescript/ban-ts-comment": [
63+
"error",
64+
{
65+
"minimumDescriptionLength": 3,
66+
"ts-check": false,
67+
"ts-expect-error": "allow-with-description",
68+
"ts-ignore": true,
69+
"ts-nocheck": true
70+
}
71+
],
72+
"typescript/consistent-type-imports": [
73+
"error",
74+
{
75+
"fixStyle": "inline-type-imports"
76+
}
77+
],
78+
"typescript/no-confusing-non-null-assertion": "error",
79+
"typescript/no-extra-non-null-assertion": "error",
80+
"typescript/no-misused-promises": [
81+
"error",
82+
{
83+
"checksVoidReturn": false
84+
}
85+
],
86+
"typescript/no-restricted-types": "error",
87+
"typescript/no-unnecessary-boolean-literal-compare": "error",
88+
"typescript/no-unnecessary-type-arguments": "error",
89+
"typescript/no-unnecessary-type-assertion": "error",
90+
"typescript/no-unnecessary-type-constraint": "error",
91+
"typescript/prefer-includes": "error",
92+
"typescript/prefer-nullish-coalescing": "error",
93+
"typescript/prefer-readonly": "error",
94+
"typescript/return-await": ["error", "error-handling-correctness-only"],
95+
"typescript/unbound-method": "off",
96+
"unicorn/consistent-date-clone": "error",
97+
"unicorn/consistent-empty-array-spread": "error",
98+
"unicorn/consistent-existence-index-check": "error",
99+
"unicorn/error-message": "error",
100+
"unicorn/no-anonymous-default-export": "error",
101+
"unicorn/no-immediate-mutation": "error",
102+
"unicorn/no-length-as-slice-end": "error",
103+
"unicorn/no-object-as-default-parameter": "error",
104+
"unicorn/no-unnecessary-array-splice-count": "error",
105+
"unicorn/no-useless-collection-argument": "error",
106+
"unicorn/numeric-separators-style": "error",
107+
"unicorn/prefer-array-find": "error",
108+
"unicorn/prefer-array-flat": "error",
109+
"unicorn/prefer-array-flat-map": "error",
110+
"unicorn/prefer-array-some": "error",
111+
"unicorn/prefer-date-now": "error",
112+
"unicorn/prefer-includes": "error",
113+
"unicorn/prefer-keyboard-event-key": "error",
114+
"unicorn/prefer-math-min-max": "error",
115+
"unicorn/prefer-native-coercion-functions": "error",
116+
"unicorn/prefer-node-protocol": "error",
117+
"unicorn/prefer-number-properties": "error",
118+
"unicorn/prefer-regexp-test": "error",
119+
"unicorn/prefer-string-slice": "error",
120+
"unicorn/require-number-to-fixed-digits-argument": "error"
121+
}
122+
}

.vscode/launch.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
"request": "launch",
88
"runtimeExecutable": "${execPath}",
99
"preLaunchTask": "compile",
10-
"args": [
11-
"${workspaceFolder}",
12-
"--extensionDevelopmentPath=${workspaceFolder}"
13-
],
14-
"outFiles": [
15-
"${workspaceFolder}/build/**"
16-
]
10+
"args": ["${workspaceFolder}", "--extensionDevelopmentPath=${workspaceFolder}"],
11+
"outFiles": ["${workspaceFolder}/build/**"]
1712
}
1813
]
19-
}
14+
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"group": "build"
99
}
1010
]
11-
}
11+
}

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,39 @@ and performing actions related to the chosen package inside the built-in editor
2828

2929
## ⚡️ Features
3030

31-
* Search through the packages registered in the React Native Directory.
32-
* Narrow down the results by using filter tokens, such as `:ios`, `:newArchitecture`, or `:hasTypes`.
33-
* Valid tokens are a subset of all possible API query options, and the values can be seen [in this file](/src/utils.ts#L33-L55).
34-
* Install the selected packages in the current workspace using your preferred package manager.
35-
* Dive deep into the stats and analysis with the provided metadata and links.
31+
- Search through the packages registered in the React Native Directory.
32+
- Narrow down the results by using filter tokens, such as `:ios`, `:newArchitecture`, or `:hasTypes`.
33+
- Valid tokens are a subset of all possible API query options, and the values can be seen [in this file](/src/utils.ts#L33-L55).
34+
- Install the selected packages in the current workspace using your preferred package manager.
35+
- Dive deep into the stats and analysis with the provided metadata and links.
3636

3737
## 📦 Installation
3838

3939
#### VS Marketplace
40+
4041
1. Go to [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=react-native-directory.vscode-react-native-directory).
4142
1. Click on the **"Install"** button.
4243

4344
#### Open VSX Registry
45+
4446
1. Go to [Open VSX Registry](https://open-vsx.org/extension/react-native-directory/vscode-react-native-directory).
4547
1. Click on the **"Download"** button
4648
1. In VS Code:
47-
* Navigate to the **"Extensions"** pane (<kbd>Ctrl/Cmd+Shift+X</kbd>).
48-
* Click **"More"** button (three dots in the right corner of header) and select **"Install from VSIX"**.
49-
* Select the VSIX file downloaded earlier in the process.
49+
- Navigate to the **"Extensions"** pane (<kbd>Ctrl/Cmd+Shift+X</kbd>).
50+
- Click **"More"** button (three dots in the right corner of header) and select **"Install from VSIX"**.
51+
- Select the VSIX file downloaded earlier in the process.
5052

5153
## 📝 Contributing
5254

5355
1. Make sure you have [Bun](https://bun.sh/docs/installation) installed.
5456
1. Checkout the repository locally.
5557
1. Run the following commands to install dependencies and compile source:
56-
58+
5759
```sh
5860
bun install
5961
```
62+
6063
1. In VS Code:
61-
* Open folder containing the extension repository.
62-
* Navigate to the **"Run and Debug"** pane (<kbd>Ctrl/Cmd+Shift+D</kbd>).
63-
* Select **"Run with extension"** launch task, and press **"Start Debugging"** button (<kbd>F5</kbd>).
64+
- Open folder containing the extension repository.
65+
- Navigate to the **"Run and Debug"** pane (<kbd>Ctrl/Cmd+Shift+D</kbd>).
66+
- Select **"Run with extension"** launch task, and press **"Start Debugging"** button (<kbd>F5</kbd>).

0 commit comments

Comments
 (0)