Skip to content

feat: support more languages in napi#1171

Merged
HerringtonDarkholme merged 8 commits intomainfrom
napi-lang
May 28, 2024
Merged

feat: support more languages in napi#1171
HerringtonDarkholme merged 8 commits intomainfrom
napi-lang

Conversation

@HerringtonDarkholme
Copy link
Copy Markdown
Member

@HerringtonDarkholme HerringtonDarkholme commented May 27, 2024

fix #1170

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 27, 2024

Warning

Rate Limit Exceeded

@HerringtonDarkholme has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 38 minutes and 32 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 320b9bd and 96e762e.

Walkthrough

The changes introduce support for various new programming languages in the NAPI module. This includes updating enums to string literals, adding parsing and processing functions, and modifying structs and methods to handle these new languages. Additionally, tests and file handling logic have been adjusted to accommodate the expanded language support.

Changes

Files/Directories Change Summary
crates/napi/Cargo.toml Added ast-grep-language as a workspace dependency.
crates/napi/index.d.ts Updated FrontEndLanguage enum to use string literals and added new languages. Introduced new functions for parsing and processing code.
crates/napi/src/doc.rs Updated usage of language types from FrontEndLanguage to SupportLang. Modified structs and methods to use SupportLang.
crates/napi/src/fe_lang.rs Added new languages to FrontEndLanguage enum. Implemented conversions between FrontEndLanguage and SupportLang.
crates/napi/src/lib.rs Introduced SupportLang, updated functions to accept Lang enum, and modified RuleCore to use SupportLang.
crates/napi/src/sg_node.rs Modified logic related to parsing config with lang.
crates/napi/src/find_files.rs Added functionality for parsing and iterating files asynchronously, supporting language-specific file parsing and node matching.
crates/napi/src/napi_lang.rs Introduced enums for various programming languages, conversion functions, file searching, and utility functions for managing file types.
crates/napi/__test__/index.spec.ts Added new import parse as parseWithLang and a test function for parsing Python code.
crates/napi/index.js Restructured exports to include additional properties like parse, parseAsync, kind, pattern, and findInFiles.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant NAPI
    participant SupportLang
    User->>NAPI: Call parse(lang, src)
    NAPI->>SupportLang: Convert lang to SupportLang
    SupportLang->>NAPI: Return converted lang
    NAPI->>User: Return parsed SgRoot
Loading

Assessment against linked issues

Objective Addressed Explanation
Support more languages in NAPI (#1170)

In code we trust, in languages we delve,
New tongues we support, in NAPI we excel.
Parsing and processing, with ease and grace,
Expanding our reach, to every codebase.
🎉🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 73.57%. Comparing base (01f9453) to head (96e762e).

Files Patch % Lines
crates/napi/src/find_files.rs 0.00% 23 Missing ⚠️
crates/napi/src/napi_lang.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1171      +/-   ##
==========================================
+ Coverage   73.43%   73.57%   +0.14%     
==========================================
  Files          76       76              
  Lines        5239     5229      -10     
==========================================
  Hits         3847     3847              
+ Misses       1392     1382      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
crates/napi/index.d.ts (1)

Line range hint 12-12: Consider specifying more precise types instead of any for better type safety.

- rule: any
+ rule: RuleType // Define RuleType based on expected structure

Also applies to: 14-14, 18-18, 20-20

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 01f9453 and 9f5a878.
Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing (6)
  • crates/napi/Cargo.toml (1 hunks)
  • crates/napi/index.d.ts (1 hunks)
  • crates/napi/src/doc.rs (7 hunks)
  • crates/napi/src/fe_lang.rs (5 hunks)
  • crates/napi/src/lib.rs (6 hunks)
  • crates/napi/src/sg_node.rs (2 hunks)
Additional Context Used
Biome (5)
crates/napi/index.d.ts (5)

12-12: Unexpected any. Specify a different type.


14-14: Unexpected any. Specify a different type.


18-18: Unexpected any. Specify a different type.


20-20: Unexpected any. Specify a different type.


22-46: The enum declaration should not be const

Additional comments not posted (5)
crates/napi/Cargo.toml (1)

16-16: Dependency addition looks good and aligns with the PR's objectives.

crates/napi/src/doc.rs (1)

6-6: Changes to use SupportLang are correctly implemented and align with the PR's objectives to support more languages.

Also applies to: 32-34, 126-126, 131-131, 140-140, 172-172, 181-181, 193-193

crates/napi/src/fe_lang.rs (1)

1-1: Expansion of FrontEndLanguage and implementation of conversion methods are correctly done to support additional languages.

Also applies to: 13-38, 41-69, 73-100, 105-105, 113-120, 129-131, 146-149, 158-167, 180-185

crates/napi/src/sg_node.rs (1)

183-183: Changes in SgNode to use the new language support are correctly implemented.

Also applies to: 223-223

crates/napi/src/lib.rs (1)

11-11: Integration of SupportLang and updates to file handling are correctly implemented.

Also applies to: 36-36, 54-55, 103-103, 229-229

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (2)
crates/napi/src/find_files.rs (2)

19-22: Define the purpose of ParseAsync struct clearly in a comment.

Adding a comment explaining the role of ParseAsync would improve code readability and maintainability.


40-45: Clarify the type parameter D in IterateFiles.

It would be beneficial to add a comment explaining the purpose and expected type of the generic parameter D in the IterateFiles struct.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 9f5a878 and 9aa4ad0.
Files selected for processing (2)
  • crates/napi/src/find_files.rs (1 hunks)
  • crates/napi/src/lib.rs (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/napi/src/lib.rs
Additional comments not posted (4)
crates/napi/src/find_files.rs (4)

101-122: Review the error handling in parse_files function.

Verification successful

The parse_files function employs standard Rust error handling practices, including the use of the Result type and the ? operator to propagate errors. Here are the key points of error handling within the function:

  • The creation of the ThreadsafeFunction uses the ? operator to handle potential errors.
  • The match statement correctly handles different variants of paths.
  • The call to build_files also uses the ? operator to propagate errors.
  • The final Ok result is correctly constructed with the necessary components.

Based on this detailed inspection, the error handling in the parse_files function appears to be robust and follows best practices.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that error handling is robust in `parse_files`.

# Test: Search for error handling patterns in `parse_files`.
ast-grep --lang rust --pattern $'fn parse_files($_, $_) { $$$ }'

Length of output: 65



Script:

#!/bin/bash
# Locate the `parse_files` function definition in the codebase.
rg 'fn parse_files' -t rust

# Once located, extract the function definition and its body for detailed inspection.
# Assuming the function is found in `crates/napi/src/find_files.rs`, extract lines around its definition.
rg -A 20 -B 5 'fn parse_files' crates/napi/src/find_files.rs

Length of output: 1008


178-199: Validate the logic in find_in_files_impl.

Verification successful

The logic in find_in_files_impl appears to be correctly implemented based on the components used:

  • create_threadsafe_function is used to create a threadsafe function from the callback.
  • parse_with is used to parse a rule with the matcher.
  • find_files is used to find files using the language-specific method.
  • AsyncTask::new is used to create a new asynchronous task with the gathered data.

These components are used appropriately within the function, and their definitions and usages align with the intended functionality.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the logic in `find_in_files_impl` matches the intended functionality.

# Test: Search for the implementation of `find_in_files_impl`.
ast-grep --lang rust --pattern $'fn find_in_files_impl($_, $_, $_) { $$$ }'

Length of output: 76



Script:

#!/bin/bash
# Description: Verify the logic in `find_in_files_impl` matches the intended functionality.

# Test: Search for the implementation of `find_in_files_impl` in the entire codebase.
rg 'fn find_in_files_impl' -A 20

Length of output: 1249



Script:

#!/bin/bash
# Description: Verify the components used in `find_in_files_impl`.

# Test: Search for the definition and usage of `create_threadsafe_function`.
rg 'create_threadsafe_function' -A 5

# Test: Search for the definition and usage of `parse_with`.
rg 'parse_with' -A 5

# Test: Search for the definition and usage of `find_files`.
rg 'find_files' -A 5

# Test: Search for the definition and usage of `AsyncTask::new`.
rg 'AsyncTask::new' -A 5

Length of output: 7380


124-142: Ensure that call_sg_root function handles all possible errors.


28-32: Ensure proper error handling in compute method of ParseAsync.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
crates/napi/index.js (1)

Line range hint 7-8: Use the node: protocol for built-in modules.

- const { existsSync, readFileSync } = require('fs')
+ const { existsSync, readFileSync } = require('node:fs')
- const { join } = require('path')
+ const { join } = require('node:path')
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
+ const lddPath = require('node:child_process').execSync('which ldd').toString().trim()

Also applies to: 20-20

crates/napi/index.d.ts (1)

Line range hint 12-12: Consider replacing any with more specific types to improve type safety and code clarity.

// Example for `rule` in `NapiConfig`
rule: RuleConfig // Assuming RuleConfig is an appropriate type

Also applies to: 14-14, 18-18, 20-20

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 9aa4ad0 and 4407d9a.
Files selected for processing (3)
  • crates/napi/index.d.ts (2 hunks)
  • crates/napi/index.js (1 hunks)
  • crates/napi/src/lib.rs (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/napi/src/lib.rs
Additional Context Used
Biome (9)
crates/napi/index.d.ts (5)

12-12: Unexpected any. Specify a different type.


14-14: Unexpected any. Specify a different type.


18-18: Unexpected any. Specify a different type.


20-20: Unexpected any. Specify a different type.


22-46: The enum declaration should not be const

crates/napi/index.js (4)

7-7: A Node.js builtin module should be imported with the node: protocol.


8-8: A Node.js builtin module should be imported with the node: protocol.


20-20: A Node.js builtin module should be imported with the node: protocol.


281-281: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (2)
crates/napi/index.js (1)

284-294: The module exports are correctly structured and follow Node.js best practices.

crates/napi/index.d.ts (1)

23-45: The update to string literals in the FrontEndLanguage enum enhances readability. However, remember that this file is auto-generated, and manual changes might be overwritten.

napi is no longer frontend only
BREAKING CHANGE: rename FrontendLanguage to Lang
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Outside diff range and nitpick comments (3)
crates/napi/__test__/index.spec.ts (1)

3-3: The imports should be organized and possibly consolidated to improve readability and maintainability.

Consider organizing imports in a grouped manner:

import { js, parseFiles, ts, tsx, html, parse as parseWithLang } from '../index';
crates/napi/index.js (1)

Line range hint 7-7: Consider using the node: protocol when importing Node.js built-in modules to ensure compatibility with newer Node.js versions.

- const { existsSync, readFileSync } = require('fs')
+ const { existsSync, readFileSync } = require('node:fs')
- const { join } = require('path')
+ const { join } = require('node:path')
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
+ const lddPath = require('node:child_process').execSync('which ldd').toString().trim()

Also applies to: 8-8, 20-20

crates/napi/index.d.ts (1)

Line range hint 12-12: Consider replacing the any type with more specific types to improve type safety and maintainability.

interface NapiConfig {
  rule: RuleType; // Define RuleType based on the structure expected
  constraints?: ConstraintsType; // Define ConstraintsType based on the structure expected
  transform?: TransformType; // Define TransformType based on the structure expected
  utils?: UtilsType; // Define UtilsType based on the structure expected
}

Also applies to: 14-14, 18-18, 20-20

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4407d9a and 23653bd.
Files selected for processing (7)
  • crates/napi/test/index.spec.ts (2 hunks)
  • crates/napi/index.d.ts (2 hunks)
  • crates/napi/index.js (1 hunks)
  • crates/napi/src/doc.rs (7 hunks)
  • crates/napi/src/find_files.rs (1 hunks)
  • crates/napi/src/lib.rs (3 hunks)
  • crates/napi/src/napi_lang.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/napi/src/doc.rs
Additional Context Used
Biome (29)
crates/napi/__test__/index.spec.ts (20)

11-11: Forbidden non-null assertion.


15-15: Forbidden non-null assertion.


16-16: Forbidden non-null assertion.


25-25: Forbidden non-null assertion.


29-29: Forbidden non-null assertion.


30-30: Forbidden non-null assertion.


39-39: Forbidden non-null assertion.


43-43: Forbidden non-null assertion.


55-56: Forbidden non-null assertion.


60-61: Forbidden non-null assertion.


70-83: Forbidden non-null assertion.


90-91: Forbidden non-null assertion.


134-137: Forbidden non-null assertion.


134-134: Forbidden non-null assertion.


141-141: Forbidden non-null assertion.


152-152: Forbidden non-null assertion.


173-174: Unnecessary continue statement


185-185: The computed expression can be simplified without the use of a string literal.


220-220: Unnecessary continue statement


284-284: Unexpected any. Specify a different type.

crates/napi/index.d.ts (5)

12-12: Unexpected any. Specify a different type.


14-14: Unexpected any. Specify a different type.


18-18: Unexpected any. Specify a different type.


20-20: Unexpected any. Specify a different type.


39-63: The enum declaration should not be const

crates/napi/index.js (4)

7-7: A Node.js builtin module should be imported with the node: protocol.


8-8: A Node.js builtin module should be imported with the node: protocol.


20-20: A Node.js builtin module should be imported with the node: protocol.


281-281: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (9)
crates/napi/src/lib.rs (5)

4-5: Ensure all newly imported modules are utilized effectively in the file.

Also applies to: 15-17

Verification successful

The newly imported modules find_files and napi_lang are indeed utilized within the file crates/napi/src/lib.rs. The references include:

  • use find_files::{find_in_files_impl, FindConfig, FindInFiles, ParseAsync};
  • use napi_lang::Lang;
  • pub use find_files::parse_files;

These usages confirm that the modules are effectively integrated into the code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the newly imported modules are used in the file.

# Test: Search for usage of the modules. Expect: References to these modules in the code.
rg --type rust --files-with-matches 'find_files|napi_lang' crates/napi/src/lib.rs

Length of output: 106



Script:

#!/bin/bash
# Description: Verify specific usages of the modules `find_files` and `napi_lang` in the file.

# Test: Search for function calls or usage patterns related to these modules.
rg --type rust 'find_files|napi_lang' crates/napi/src/lib.rs

Length of output: 222


68-72: The use of aliases for functions to resolve name conflicts is a good practice. However, ensure that these aliases do not introduce any unexpected behaviors or bugs.

Verification successful

The aliases kind_with_lang, parse_with_lang, parse_async_with_lang, and pattern_with_lang are used consistently within the crates/napi/src/lib.rs file. The context around their usage indicates that they are correctly mapped to their respective functions without introducing unexpected behaviors.

  • Lines 31, 41, 46, and 51 show the aliases being used in function definitions.
  • The surrounding code confirms that these aliases are used appropriately and maintain the expected behavior of the original functions.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the function aliases do not introduce unexpected behaviors.

# Test: Search for usages of the aliases. Expect: Consistent behavior with the original functions.
rg --type rust --files-with-matches 'kind_with_lang|parse_with_lang|parse_async_with_lang|pattern_with_lang' crates/napi/src/lib.rs

Length of output: 156



Script:

#!/bin/bash
# Extract lines where the aliases are used in crates/napi/src/lib.rs
rg 'kind_with_lang|parse_with_lang|parse_async_with_lang|pattern_with_lang' crates/napi/src/lib.rs -n

Length of output: 430



Script:

#!/bin/bash
# Extract surrounding lines for each alias usage in crates/napi/src/lib.rs
rg 'kind_with_lang|parse_with_lang|parse_async_with_lang|pattern_with_lang' crates/napi/src/lib.rs -A 3 -B 3

Length of output: 1260


99-103: The function kind and pattern involve complex operations with potential for optimization. Review these functions for any possible improvements in efficiency or error handling.

Also applies to: 108-109


82-84: The functions parse and parse_async are critical for the functionality of the library. Review their implementations for any potential issues with memory management, especially with the use of JsDoc::new and AsyncTask::new.

Also applies to: 93-94


26-26: The helper functions parse_with_lang, parse_async_with_lang, kind_with_lang, and pattern_with_lang are used to abstract common functionality. Ensure these functions handle errors appropriately and are optimized for performance.

Also applies to: 31-31, 41-41, 46-46, 51-51

crates/napi/src/find_files.rs (1)

19-22: The ParseAsync struct and its implementation of the Task trait are well-defined. Ensure that the compute and resolve methods handle all possible errors and edge cases.

Also applies to: 24-36

crates/napi/src/napi_lang.rs (1)

13-39: The Lang enum and its conversions to and from SupportLang are crucial for the functionality of the library. Ensure that all language conversions are correctly implemented and cover all cases.

Also applies to: 41-71, 73-103

Verification successful

The implementations for Into<SupportLang> and From<SupportLang> in crates/napi/src/napi_lang.rs appear to cover all the variants of the Lang enum. Each variant of Lang is correctly mapped to its corresponding SupportLang variant and vice versa.

  • Into<SupportLang> implementation (lines 41-71)
  • From<SupportLang> implementation (lines 73-103)

These implementations ensure that all language conversions are correctly handled.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correctness of language conversions.

# Test: Search for the implementation of conversions. Expect: Correct and complete implementation.
rg --type rust --files-with-matches 'Into<SupportLang>|From<SupportLang>' crates/napi/src/napi_lang.rs

Length of output: 133



Script:

#!/bin/bash
# Extract and display the implementations of `Into<SupportLang>` and `From<SupportLang>` from `crates/napi/src/napi_lang.rs`
ast-grep --lang rust --pattern 'impl Into<SupportLang> for Lang { $$$ }' crates/napi/src/napi_lang.rs
ast-grep --lang rust --pattern 'impl From<SupportLang> for Lang { $$$ }' crates/napi/src/napi_lang.rs

Length of output: 3741

crates/napi/index.js (1)

284-294: The export statements for parseFiles, Lang, and other entities have been added. Ensure that these entities are properly defined and implemented in the native bindings.

crates/napi/index.d.ts (1)

16-16: The TypeScript definitions have been updated to include new interfaces and functions, and the Lang enum has been expanded to include more languages. Ensure that these changes are reflected in the implementation and that they align with the project's goals to support more languages.

Also applies to: 22-26, 27-38, 39-62, 86-106

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 23653bd and 320b9bd.
Files selected for processing (1)
  • crates/napi/test/index.spec.ts (2 hunks)
Additional Context Used
Biome (20)
crates/napi/__test__/index.spec.ts (20)

15-15: Forbidden non-null assertion.


19-19: Forbidden non-null assertion.


20-20: Forbidden non-null assertion.


29-29: Forbidden non-null assertion.


33-33: Forbidden non-null assertion.


34-34: Forbidden non-null assertion.


43-43: Forbidden non-null assertion.


47-47: Forbidden non-null assertion.


59-60: Forbidden non-null assertion.


64-65: Forbidden non-null assertion.


74-87: Forbidden non-null assertion.


94-95: Forbidden non-null assertion.


138-141: Forbidden non-null assertion.


138-138: Forbidden non-null assertion.


145-145: Forbidden non-null assertion.


156-156: Forbidden non-null assertion.


177-178: Unnecessary continue statement


189-189: The computed expression can be simplified without the use of a string literal.


224-224: Unnecessary continue statement


288-288: Unexpected any. Specify a different type.

Additional comments not posted (2)
crates/napi/__test__/index.spec.ts (2)

308-315: The test for parsing Python code is well-implemented and correctly tests the basic functionality.


317-324: The asynchronous test for parsing Python code is correctly implemented and follows the new enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] support more languages in napi

1 participant