Sha256: 7e20718c56cd27c033a0666db837a3b0015217ac2f438693ae61e48518adac5f

Contents?: true

Size: 1.3 KB

Versions: 8

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

say_git "Install eslint"
add_yarn_packages(
  "@eslint/js",
  "eslint@^9",
  "eslint-config-prettier",
  "eslint-formatter-compact",
  "eslint-plugin-prettier",
  "prettier",
  "npm-run-all",
  "@types/eslint",
  dev: true
)
add_package_json_scripts(
  "lint:js": "eslint 'app/{assets,components,frontend,javascript}/**/*.{cjs,js,jsx,ts,tsx}'",
  "fix:js": "npm run -- lint:js --fix",
  lint: "npm-run-all lint:**",
  fix: "npm-run-all fix:**"
)
copy_file "eslint.config.js"

say_git "Add eslint to default rake task"
copy_file "lib/tasks/eslint.rake"
add_lint_task "eslint"

if File.exist?(".github/workflows/ci.yml")
  say_git "Add eslint job to CI workflow"
  node_spec = File.exist?(".node-version") ? 'node-version-file: ".node-version"' : 'node-version: "lts/*"'
  inject_into_file ".github/workflows/ci.yml", <<-YAML, after: /^jobs:\n/
  eslint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Node
        uses: actions/setup-node@v4
        with:
          #{node_spec}
          cache: yarn

      - name: Install Yarn packages
        run: npx --yes ci

      - name: Lint JavaScript files with eslint
        run: yarn lint:js

  YAML
end

say_git "Auto-correct any existing issues"
run "yarn fix:js", capture: true

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nextgen-0.26.0 lib/nextgen/generators/eslint.rb
nextgen-0.25.0 lib/nextgen/generators/eslint.rb
nextgen-0.24.0 lib/nextgen/generators/eslint.rb
nextgen-0.23.0 lib/nextgen/generators/eslint.rb
nextgen-0.22.0 lib/nextgen/generators/eslint.rb
nextgen-0.21.0 lib/nextgen/generators/eslint.rb
nextgen-0.20.0 lib/nextgen/generators/eslint.rb
nextgen-0.19.0 lib/nextgen/generators/eslint.rb