Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running as pre-commit hook: SyntaxError: Unexpected token ; #355

Closed
okainov opened this issue Jan 18, 2024 · 2 comments
Closed
Labels

Comments

@okainov
Copy link

okainov commented Jan 18, 2024

I've just tried to add npm-groovy-lint to my repo as pre-commit hook but I'm getting following error:

SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/nfs/site/home/okainov/.cache/pre-commit/repohkeo9dc_/node_env-system/lib/node_modules/npm-groovy-lint/lib/index.js:4:23)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
/nfs/site/home/okainov/.cache/pre-commit/repohkeo9dc_/node_env-system/lib/node_modules/npm-groovy-lint/lib/groovy-lint.js:18
    "use strict";
                ^

SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/nfs/site/home/okainov/.cache/pre-commit/repohkeo9dc_/node_env-system/lib/node_modules/npm-groovy-lint/lib/index.js:4:23)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Pre-commit configuration:

  - repo: https://github.com/nvuillam/npm-groovy-lint
    rev: v14.2.0
    hooks:
      - id: npm-groovy-lint
        name: Lint groovy files
        description: Groovy & Jenkinsfile Linter
        entry: npm-groovy-lint --output txt
        language: node
        types: [groovy]
      - id: format-npm-groovy-lint
        name: Format Lint groovy findings
        description: Groovy & Jenkinsfile Formatter
        entry: npm-groovy-lint --format --output txt
        language: node
        types: [groovy]
      - id: fix-npm-groovy-lint
        name: Fix Lint groovy findings
        description: Groovy & Jenkinsfile Auto-fixer
        entry: npm-groovy-lint --fix  --output txt
        language: node
        types: [groovy]

node --version gives v10.19.0

@nvuillam
Copy link
Owner

node v10 is quite old, npm-groovy-lint requires node v18 minimum, please can you upgrade and try again ?

@stevenh stevenh added the awaiting feedback Waiting for feedback label Jan 26, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants