Giter VIP home page Giter VIP logo

docker-eslint's Introduction

Docker image for eslint

Tag License

lint build nightly

All #awesome-ci Docker images

ansible-lint ansible awesome-ci bandit black checkmake eslint file-lint gofmt goimports golint jsonlint kubeval linkcheck mypy php-cs-fixer phpcbf phpcs phplint pycodestyle pydocstyle pylint terraform-docs terragrunt-fmt terragrunt yamlfmt yamllint

View Dockerfiles on GitHub.

Available Architectures: amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Tiny Alpine-based multistage-build dockerized version of eslint[1]. The image is built nightly against multiple stable versions and pushed to Dockerhub.

[1] Official project: https://github.com/eslint/eslint

🐳 Available Docker image versions

Docker

Rolling releaess

The following Docker image tags are rolling releases and are built and updated every night.

nightly

Docker Tag Git Ref Eslint Flavour Available Architectures
latest master latest default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine master latest Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
8 master 8.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-8 master 8.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
7 master 7.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-7 master 7.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
6 master 6.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-6 master 6.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
5 master 5.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-5 master 5.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
4 master 4.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-4 master 4.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
3 master 3.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-3 master 3.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
2 master 2.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-2 master 2.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
1 master 1.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-1 master 1.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Point in time releases

The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.

build

Docker Tag Git Ref Eslint Flavour Available Architectures
latest-<tag> tag: <tag> latest default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-latest-<tag> tag: <tag> latest Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
8-<tag> tag: <tag> 8.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-8-<tag> tag: <tag> 8.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
7-<tag> tag: <tag> 7.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-7-<tag> tag: <tag> 7.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
6-<tag> tag: <tag> 6.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-6-<tag> tag: <tag> 6.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
5-<tag> tag: <tag> 5.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-5-<tag> tag: <tag> 5.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
4-<tag> tag: <tag> 4.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-4-<tag> tag: <tag> 4.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
3-<tag> tag: <tag> 3.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-3-<tag> tag: <tag> 3.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
2-<tag> tag: <tag> 2.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-2-<tag> tag: <tag> 2.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
1-<tag> tag: <tag> 1.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-1-<tag> tag: <tag> 1.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Where <tag> refers to the chosen git tag from this repository.

📂 Docker mounts

The working directory inside the Docker container is /data/ and should be mounted locally to where your .eslint config file is located.

💻 Usage

Lint JS files

docker run -it --rm -v $(pwd):/data cytopia/eslint .
/data/index.js
  3:1  error  Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

Travis CI example

travis.yml

---
sudo: required
language: minimal
services:
  - docker
script:
  docker run -it --rm -v $(pwd):/data cytopia/eslint .

🔄 Related #awesome-ci projects

Docker images

Save yourself from installing lot's of dependencies and pick a dockerized version of your favourite linter below for reproducible local or remote CI tests:

GitHub DockerHub Type Description
awesome-ci aci-hub-img Basic Tools for git, file and static source code analysis
file-lint flint-hub-img Basic Baisc source code analysis
linkcheck linkcheck-hub-img Basic Search for URLs in files and validate their HTTP status code
ansible ansible-hub-img Ansible Multiple versions and flavours of Ansible
ansible-lint alint-hub-img Ansible Lint Ansible
gofmt gfmt-hub-img Go Format Go source code [1]
goimports gimp-hub-img Go Format Go source code [1]
golint glint-hub-img Go Lint Go code
eslint elint-hub-img Javascript Lint Javascript code
jsonlint jlint-hub-img JSON Lint JSON files [1]
kubeval kubeval-hub-img K8s Lint Kubernetes files
checkmake cm-hub-img Make Lint Makefiles
phpcbf pcbf-hub-img PHP PHP Code Beautifier and Fixer
phpcs pcs-hub-img PHP PHP Code Sniffer
phplint plint-hub-img PHP PHP Code Linter [1]
php-cs-fixer pcsf-hub-img PHP PHP Coding Standards Fixer
bandit bandit-hub-img Python A security linter from PyCQA
black black-hub-img Python The uncompromising Python code formatter
mypy mypy-hub-img Python Static source code analysis
pycodestyle pycs-hub-img Python Python style guide checker
pydocstyle pyds-hub-img Python Python docstyle checker
pylint pylint-hub-img Python Python source code, bug and quality checker
terraform-docs tfdocs-hub-img Terraform Terraform doc generator (TF 0.12 ready) [1]
terragrunt tg-hub-img Terraform Terragrunt and Terraform
terragrunt-fmt tgfmt-hub-img Terraform terraform fmt for Terragrunt files [1]
yamlfmt yfmt-hub-img Yaml Format Yaml files [1]
yamllint ylint-hub-img Yaml Lint Yaml files

[1] Uses a shell wrapper to add enhanced functionality not available by original project.

Makefiles

Visit cytopia/makefiles for dependency-less, seamless project integration and minimum required best-practice code linting for CI. The provided Makefiles will only require GNU Make and Docker itself removing the need to install anything else.

📄 License

MIT License

Copyright (c) 2019 cytopia

docker-eslint's People

Contributors

cytopia avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-eslint's Issues

Support for multi architecture

I am on mac with M1.
When I try to run the image.

 docker run -it --rm -v $(pwd):/data cytopia/eslint  --fix './resources/**/*.{ts,tsx}'
Unable to find image 'cytopia/eslint:latest' locally
latest: Pulling from cytopia/eslint
188c0c94c7c5: Already exists 
de87accb54ce: Pull complete 
509f719f6236: Pull complete 
a8041d073463: Pull complete 
Digest: sha256:de4d559d59dcd24c5910e32a2d0da52d3f2d376e812a67388716ba4805914b3e
Status: Downloaded newer image for cytopia/eslint:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

You could add multi architecture build by following command.
https://github.com/Legion112/docker-phpcov/blob/main/Makefile#L3-L4

Support for SARIF format

Hi! When running the following command

docker run -it --rm -v $(pwd):/data cytopia/eslint -f sarif .

This error message appears:

There was a problem loading formatter: /usr/local/lib/node_modules/eslint/lib/cli-engine/formatters/sarif
Error: Cannot find module '/usr/local/lib/node_modules/eslint/lib/cli-engine/formatters/sarif'
Require stack:
- /usr/local/lib/node_modules/eslint/lib/cli-engine/cli-engine.js
- /usr/local/lib/node_modules/eslint/lib/eslint/eslint.js
- /usr/local/lib/node_modules/eslint/lib/eslint/index.js
- /usr/local/lib/node_modules/eslint/lib/cli.js
- /usr/local/lib/node_modules/eslint/bin/eslint.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.