Skip to content

Commit 981f7b7

Browse files
authored
Merge pull request #661 from napi-rs/deno-lint
feat(deno-lint): upgrade denolint
2 parents ca0c191 + a679128 commit 981f7b7

File tree

12 files changed

+1186
-1512
lines changed

12 files changed

+1186
-1512
lines changed

.taplo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exclude = ["node_modules/**/*.toml"]
2+
3+
# https://taplo.tamasfe.dev/configuration/formatter-options.html
4+
[formatting]
5+
align_entries = true
6+
indent_tables = true
7+
reorder_keys = true

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ nodeLinker: node-modules
22

33
npmRegistryServer: 'https://registry.npmjs.org/'
44

5+
plugins:
6+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
7+
spec: '@yarnpkg/plugin-workspace-tools'
8+
59
yarnPath: .yarn/releases/yarn-3.3.1.cjs

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,30 @@ Make rust crates binding to Node.js use [napi-rs](https://github.com/napi-rs/nap
1010

1111
# Support matrix
1212

13-
| | node12 | node14 | node16 | node18 |
14-
| --------------------- | ------ | ------ | ------ | ------ |
15-
| Windows x64 |||||
16-
| Windows x32 |||||
17-
| Windows arm64 |||||
18-
| macOS x64 |||||
19-
| macOS arm64 (m chips) |||||
20-
| Linux x64 gnu |||||
21-
| Linux x64 musl |||||
22-
| Linux arm gnu |||||
23-
| Linux arm64 gnu |||||
24-
| Linux arm64 musl |||||
25-
| Android arm64 |||||
26-
| Android armv7 |||||
27-
| FreeBSD x64 |||||
13+
| | node12 | node14 | node16 | node18 |
14+
| ---------------------------- | ------ | ------ | ------ | ------ |
15+
| Windows x64 |||||
16+
| Windows x32 |||||
17+
| Windows arm64 |||||
18+
| macOS x64 |||||
19+
| macOS arm64 (m chips) |||||
20+
| Linux x64 gnu (glibc 2.17) |||||
21+
| Linux x64 musl |||||
22+
| Linux arm gnu (glibc 2.17) |||||
23+
| Linux arm64 gnu (glibc 2.17) |||||
24+
| Linux arm64 musl |||||
25+
| Android arm64 |||||
26+
| Android armv7 |||||
27+
| FreeBSD x64 |||||
2828

2929
# Packages
3030

31-
| Package | Version | Downloads | Description |
32-
| -------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- |
33-
| [`@node-rs/crc32`](./packages/crc32) | ![](https://img.shields.io/npm/v/@node-rs/crc32.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
34-
| [`@node-rs/jieba`](./packages/jieba) | ![](https://img.shields.io/npm/v/@node-rs/jieba.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
35-
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://img.shields.io/npm/v/@node-rs/bcrypt.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
36-
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://img.shields.io/npm/v/@node-rs/deno-lint.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) Node.js binding |
37-
| [`@node-rs/xxhash`](./packages/xxhash) | ![](https://img.shields.io/npm/v/@node-rs/xxhash.svg) | ![](https://img.shields.io/npm/dm/@node-rs/xxhash.svg?sanitize=true) | [`xxhash-rust`](https://github.com/DoumanAsh/xxhash-rust) Node.js binding |
38-
| [`@node-rs/argon2`](./packages/argon2) | ![](https://img.shields.io/npm/v/@node-rs/argon2.svg) | ![](https://img.shields.io/npm/dm/@node-rs/argon2.svg?sanitize=true) | [argon2](https://crates.io/crates/argon2) binding for Node.js. |
31+
| Package | Version | Downloads | Description |
32+
| -------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
33+
| [`@node-rs/crc32`](./packages/crc32) | ![](https://img.shields.io/npm/v/@node-rs/crc32.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
34+
| [`@node-rs/jieba`](./packages/jieba) | ![](https://img.shields.io/npm/v/@node-rs/jieba.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
35+
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://img.shields.io/npm/v/@node-rs/bcrypt.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
36+
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://img.shields.io/npm/v/@node-rs/deno-lint.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) Node.js binding |
37+
| [`@node-rs/xxhash`](./packages/xxhash) | ![](https://img.shields.io/npm/v/@node-rs/xxhash.svg) | ![](https://img.shields.io/npm/dm/@node-rs/xxhash.svg?sanitize=true) | [`xxhash-rust`](https://github.com/DoumanAsh/xxhash-rust) Node.js binding |
38+
| [`@node-rs/argon2`](./packages/argon2) | ![](https://img.shields.io/npm/v/@node-rs/argon2.svg) | ![](https://img.shields.io/npm/dm/@node-rs/argon2.svg?sanitize=true) | [argon2](https://crates.io/crates/argon2) binding for Node.js. |
39+
| [`@node-rs/jsonwebtoken`](./packages/jsonwebtoken) | ![](https://img.shields.io/npm/v/@node-rs/jsonwebtoken.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jsonwebtoken.svg?sanitize=true) | [jsonwebtoken](https://github.com/Keats/jsonwebtoken) binding for Node.js. |

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"packages/*"
1111
],
1212
"scripts": {
13-
"artifacts": "lerna run artifacts",
13+
"artifacts": "yarn workspaces foreach --no-private run artifacts",
1414
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
15-
"build": "lerna run build --concurrency 1 --stream --no-prefix",
15+
"build": "yarn workspaces foreach --no-private -j 1 run build",
1616
"build:ts": "tsc -b tsconfig.project.json -verbose",
1717
"lint": "eslint . -c ./.eslintrc.yml \"packages/**/*.{ts,js}\"",
1818
"test": "ava",
@@ -24,30 +24,30 @@
2424
"postinstall": "husky install"
2525
},
2626
"devDependencies": {
27-
"@napi-rs/cli": "2.14.0",
28-
"@swc-node/core": "^1.9.1",
29-
"@swc-node/register": "^1.5.4",
30-
"@swc/core": "^1.3.24",
27+
"@napi-rs/cli": "2.14.8",
28+
"@swc-node/core": "^1.10.1",
29+
"@swc-node/register": "^1.6.2",
30+
"@swc/core": "^1.3.37",
3131
"@taplo/cli": "^0.5.2",
32-
"@types/node": "^18.11.18",
33-
"@typescript-eslint/eslint-plugin": "^5.48.0",
34-
"@typescript-eslint/parser": "^5.48.0",
35-
"ava": "^5.1.0",
32+
"@types/node": "^18.14.6",
33+
"@typescript-eslint/eslint-plugin": "^5.54.0",
34+
"@typescript-eslint/parser": "^5.54.0",
35+
"ava": "^5.2.0",
3636
"benchmark": "^2.1.4",
3737
"codecov": "^3.8.3",
3838
"cross-env": "^7.0.3",
39-
"eslint": "^8.31.0",
39+
"eslint": "^8.35.0",
4040
"eslint-config-prettier": "^8.6.0",
41-
"eslint-plugin-import": "^2.26.0",
41+
"eslint-plugin-import": "^2.27.5",
4242
"eslint-plugin-prettier": "^4.2.1",
43-
"husky": "^8.0.2",
44-
"lerna": "^6.3.0",
45-
"lint-staged": "^13.1.0",
43+
"husky": "^8.0.3",
44+
"lerna": "^6.5.1",
45+
"lint-staged": "^13.1.2",
4646
"npm-run-all": "^4.1.5",
47-
"prettier": "^2.8.1",
47+
"prettier": "^2.8.4",
4848
"ts-node": "^10.9.1",
49-
"tslib": "^2.4.1",
50-
"typescript": "^4.9.4"
49+
"tslib": "^2.5.0",
50+
"typescript": "^4.9.5"
5151
},
5252
"lint-staged": {
5353
"*.@(js|ts|tsx)": [

packages/argon2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
"version": "napi version"
5555
},
5656
"devDependencies": {
57-
"argon2": "^0.30.2"
57+
"argon2": "^0.30.3"
5858
}
5959
}

packages/crc32/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"devDependencies": {
6464
"@types/crc": "^3.8.0",
6565
"buffer": "^6.0.3",
66-
"crc": "^4.2.0",
66+
"crc": "^4.3.2",
6767
"sse4_crc32": "^7.0.0"
6868
},
6969
"funding": {

packages/deno-lint/Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
[package]
22
authors = ["LongYinan <[email protected]>"]
33
edition = "2021"
4-
name = "deno-lint"
4+
name = "deno-lint"
55
version = "0.1.0"
66

77
[lib]
88
crate-type = ["cdylib"]
99

1010
[dependencies]
1111
annotate-snippets = { version = "0.9", features = ["color"] }
12-
anyhow = "1"
13-
deno_ast = "=0.21.0"
14-
deno_lint = "=0.35.0"
15-
env_logger = "0.10"
16-
global_alloc = { path = "../../crates/alloc" }
17-
globwalk = "0.8"
18-
ignore = "0.4"
19-
miette = { version = "5", features = ["fancy-no-backtrace"] }
20-
napi = { version = "2", default-features = false, features = ["napi3"] }
21-
napi-derive = { version = "2" }
22-
serde = "1"
23-
serde_json = "1"
12+
anyhow = "1"
13+
deno_ast = "=0.24.0"
14+
deno_lint = "=0.41.0"
15+
env_logger = "0.10"
16+
global_alloc = { path = "../../crates/alloc" }
17+
globwalk = "0.8"
18+
ignore = "0.4"
19+
miette = { version = "5", features = ["fancy-no-backtrace"] }
20+
napi = { version = "2", default-features = false, features = ["napi3"] }
21+
napi-derive = { version = "2" }
22+
serde = "1"
23+
serde_json = "1"
2424

2525
[build-dependencies]
2626
napi-build = "2"

packages/deno-lint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"url": "https://github.com/napi-rs/node-rs/issues"
7070
},
7171
"dependencies": {
72-
"clipanion": "^3.1.0",
72+
"clipanion": "^3.2.0",
7373
"typanion": "^3.12.1"
7474
},
7575
"devDependencies": {

packages/deno-lint/src/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use deno_lint::rules::{get_filtered_rules, LintRule};
33
use serde::Deserialize;
44
use std::path::Path;
5-
use std::sync::Arc;
65

76
#[derive(Debug, Default, Deserialize)]
87
#[serde(default)]
@@ -27,7 +26,7 @@ pub struct Config {
2726
}
2827

2928
impl Config {
30-
pub fn get_rules(&self) -> Vec<Arc<dyn LintRule>> {
29+
pub fn get_rules(&self) -> Vec<&'static dyn LintRule> {
3130
get_filtered_rules(
3231
Some(self.rules.tags.clone()),
3332
Some(self.rules.exclude.clone()),
@@ -64,7 +63,7 @@ mod tests {
6463
}}
6564
}
6665

67-
fn into_codes(rules: Vec<Arc<dyn LintRule>>) -> HashSet<&'static str> {
66+
fn into_codes(rules: Vec<&'static dyn LintRule>) -> HashSet<&'static str> {
6867
rules.iter().map(|rule| rule.code()).collect()
6968
}
7069

0 commit comments

Comments
 (0)