Skip to content

Commit

Permalink
feat(deno-lint): upgrade deno-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Mar 5, 2023
1 parent 9f7b42c commit a679128
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude = ["node_modules/**/*.toml"]

# https://taplo.tamasfe.dev/configuration/formatter-options.html
[formatting]
align_entries = true
indent_tables = true
reorder_keys = true
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ nodeLinker: node-modules

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

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.3.1.cjs
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"packages/*"
],
"scripts": {
"artifacts": "lerna run artifacts",
"artifacts": "yarn workspaces foreach --no-private run artifacts",
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
"build": "lerna run build --concurrency 1 --stream --no-prefix",
"build": "yarn workspaces foreach --no-private -j 1 run build",
"build:ts": "tsc -b tsconfig.project.json -verbose",
"lint": "eslint . -c ./.eslintrc.yml \"packages/**/*.{ts,js}\"",
"test": "ava",
Expand Down
26 changes: 13 additions & 13 deletions packages/deno-lint/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[package]
authors = ["LongYinan <lynweklm@gmail.com>"]
edition = "2021"
name = "deno-lint"
name = "deno-lint"
version = "0.1.0"

[lib]
crate-type = ["cdylib"]

[dependencies]
annotate-snippets = { version = "0.9", features = ["color"] }
anyhow = "1"
deno_ast = "=0.21.0"
deno_lint = "=0.35.0"
env_logger = "0.10"
global_alloc = { path = "../../crates/alloc" }
globwalk = "0.8"
ignore = "0.4"
miette = { version = "5", features = ["fancy-no-backtrace"] }
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2" }
serde = "1"
serde_json = "1"
anyhow = "1"
deno_ast = "=0.24.0"
deno_lint = "=0.41.0"
env_logger = "0.10"
global_alloc = { path = "../../crates/alloc" }
globwalk = "0.8"
ignore = "0.4"
miette = { version = "5", features = ["fancy-no-backtrace"] }
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2" }
serde = "1"
serde_json = "1"

[build-dependencies]
napi-build = "2"
5 changes: 2 additions & 3 deletions packages/deno-lint/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use deno_lint::rules::{get_filtered_rules, LintRule};
use serde::Deserialize;
use std::path::Path;
use std::sync::Arc;

#[derive(Debug, Default, Deserialize)]
#[serde(default)]
Expand All @@ -27,7 +26,7 @@ pub struct Config {
}

impl Config {
pub fn get_rules(&self) -> Vec<Arc<dyn LintRule>> {
pub fn get_rules(&self) -> Vec<&'static dyn LintRule> {
get_filtered_rules(
Some(self.rules.tags.clone()),
Some(self.rules.exclude.clone()),
Expand Down Expand Up @@ -64,7 +63,7 @@ mod tests {
}}
}

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

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"importHelpers": false,
"module": "CommonJS",
"moduleResolution": "node",
"newLine": "LF",
Expand Down

0 comments on commit a679128

Please sign in to comment.