├── spec ├── fixtures │ ├── empty.js │ ├── .jshintrc │ ├── good.js │ ├── bitwise │ │ ├── bitwise.js │ │ └── .jshintrc │ ├── ignore │ │ ├── .jshintignore │ │ ├── checked.js │ │ ├── ignored.js │ │ └── .jshintrc │ ├── syntax │ │ └── badSyntax.js │ └── ignore-relative │ │ ├── .jshintignore │ │ ├── js │ │ ├── checked.js │ │ └── ignored.js │ │ └── .jshintrc ├── .eslintrc.js └── linter-jshint-spec.js ├── .eslintignore ├── .gitignore ├── .gitattributes ├── decls ├── jshint-json.js ├── .eslintrc.js ├── atom-package-deps.js ├── minimatch.js ├── atom.js └── atom-linter.js ├── .flowconfig ├── .github_changelog_generator ├── appveyor.yml ├── .travis.yml ├── README.md ├── .circleci └── config.yml ├── package.json ├── lib ├── main.js └── helpers.js └── CHANGELOG.md /spec/fixtures/empty.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | spec/fixtures 2 | -------------------------------------------------------------------------------- /spec/fixtures/.jshintrc: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | -------------------------------------------------------------------------------- /spec/fixtures/good.js: -------------------------------------------------------------------------------- 1 | var a = 42; 2 | -------------------------------------------------------------------------------- /spec/fixtures/bitwise/bitwise.js: -------------------------------------------------------------------------------- 1 | var a = 4 & 2; 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore/.jshintignore: -------------------------------------------------------------------------------- 1 | **/ignored.js 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore/checked.js: -------------------------------------------------------------------------------- 1 | var foo = 42; 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore/ignored.js: -------------------------------------------------------------------------------- 1 | var foo = 42; 2 | -------------------------------------------------------------------------------- /spec/fixtures/syntax/badSyntax.js: -------------------------------------------------------------------------------- 1 | var a = 42+ 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore-relative/.jshintignore: -------------------------------------------------------------------------------- 1 | js/ignored.js 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore-relative/js/checked.js: -------------------------------------------------------------------------------- 1 | var foo = 42; 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore-relative/js/ignored.js: -------------------------------------------------------------------------------- 1 | var foo = 42; 2 | -------------------------------------------------------------------------------- /spec/fixtures/ignore/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "unused": true 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/bitwise/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/ignore-relative/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "unused": true 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text eol=lf 3 | -------------------------------------------------------------------------------- /decls/jshint-json.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | declare module 'jshint-json' { 4 | declare module.exports: string; 5 | } 6 | -------------------------------------------------------------------------------- /decls/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'no-unused-vars': 'off', 4 | 'no-undef': 'off' 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /decls/atom-package-deps.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | declare module 'atom-package-deps' { 4 | declare var install: (name: string) => void; 5 | } 6 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/node_modules/* 3 | 4 | [include] 5 | 6 | [libs] 7 | decls 8 | 9 | [options] 10 | suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore 11 | -------------------------------------------------------------------------------- /.github_changelog_generator: -------------------------------------------------------------------------------- 1 | unreleased=true 2 | future-release=v3.1.6 3 | exclude_labels=duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,External,Unable to reproduce 4 | -------------------------------------------------------------------------------- /spec/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | atomtest: true, 4 | jasmine: true, 5 | }, 6 | rules: { 7 | "import/no-extraneous-dependencies": [ 8 | "error", 9 | { 10 | "devDependencies": true 11 | } 12 | ] 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | ### Project specific config ### 2 | environment: 3 | matrix: 4 | - ATOM_CHANNEL: stable 5 | - ATOM_CHANNEL: beta 6 | 7 | ### Generic setup follows ### 8 | build_script: 9 | - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1')) 10 | 11 | branches: 12 | only: 13 | - master 14 | 15 | version: "{build}" 16 | platform: x64 17 | clone_depth: 10 18 | skip_tags: true 19 | test: off 20 | deploy: off 21 | -------------------------------------------------------------------------------- /decls/minimatch.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | declare type MinimatchOptions = { 4 | debug?: boolean, 5 | nobrace?: boolean, 6 | noglobstar?: boolean, 7 | dot?: boolean, 8 | noext?: boolean, 9 | nocase?: boolean, 10 | nonull?: boolean, 11 | matchBase?: boolean, 12 | nocomment?: boolean, 13 | nonegate?: boolean, 14 | flipNegate?: boolean, 15 | } 16 | 17 | declare module 'minimatch' { 18 | declare module.exports: 19 | (path: string, pattern: string, options?: MinimatchOptions) => boolean; 20 | } 21 | -------------------------------------------------------------------------------- /decls/atom.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | declare var atom: Object; 4 | 5 | declare class Disposable { 6 | dispose(): void; 7 | } 8 | 9 | declare module 'atom' { 10 | declare class CompositeDisposable { 11 | add(...observable: Array): void; 12 | } 13 | 14 | declare type Buffer = { 15 | getLineCount: () => number, 16 | lineLengthForRow: () => number, 17 | } 18 | 19 | declare type TextEditor = { 20 | getPath: () => string, 21 | getText: () => string, 22 | getGrammar: () => { 23 | scopeName: string 24 | }, 25 | getBuffer: () => Buffer, 26 | // setCursorBufferPosition: (point: Point) => void, 27 | // scrollToCursorPosition: () => void, 28 | // onDidStopChanging: (cb: () => void) => any 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /decls/atom-linter.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | /* eslint-disable import/extensions, import/no-extraneous-dependencies */ 4 | import type { TextEditor } from 'atom'; 5 | /* eslint-enable import/extensions, import/no-extraneous-dependencies */ 6 | 7 | declare type ExecOptions = { 8 | timeout?: number, 9 | stream?: 'stdout' | 'stderr' | 'both', 10 | env?: Object, 11 | stdin?: string | Buffer, 12 | local?: { 13 | directory: string, 14 | prepend?: boolean 15 | }, 16 | throwOnStderr?: boolean, 17 | allowEmptyStderr?: boolean, 18 | ignoreExitCode?: boolean 19 | } 20 | 21 | declare module 'atom-linter' { 22 | declare var findCachedAsync: 23 | (directory: string, names: string | Array) => Promise; 24 | declare var execNode: 25 | (filePath: string, args: Array, options?: ExecOptions) => Promise; 26 | declare var generateRange: 27 | (textEditor: TextEditor, lineNumber?: number, colStart?: number) => 28 | Array> 29 | } 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ### Project specific config ### 2 | language: node_js 3 | node_js: lts/* 4 | install: skip 5 | os: linux 6 | 7 | jobs: 8 | include: 9 | # Test Atom versions 10 | - stage: test 11 | env: ATOM_CHANNEL=stable 12 | - stage: test 13 | env: ATOM_CHANNEL=beta 14 | 15 | # Check the commit messages and run the extra lint script 16 | - stage: test 17 | install: 18 | - npm install 19 | before_script: skip 20 | script: 21 | - commitlint-travis 22 | - npm run lint 23 | 24 | - stage: release 25 | # Since the deploy needs APM, currently the simplest method is to run 26 | # build-package.sh, which requires the specs to pass. 27 | before_deploy: 28 | - export PATH=${PATH}:${HOME}/atom/usr/bin/ 29 | deploy: 30 | provider: script 31 | skip_cleanup: true 32 | script: 33 | - npx semantic-release 34 | 35 | ### Generic setup follows ### 36 | script: 37 | - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh 38 | - chmod u+x build-package.sh 39 | - "./build-package.sh" 40 | 41 | notifications: 42 | email: 43 | on_success: never 44 | on_failure: change 45 | 46 | branches: 47 | only: 48 | - master 49 | - "/^greenkeeper/.*$/" 50 | 51 | git: 52 | depth: 10 53 | 54 | sudo: false 55 | 56 | dist: xenial 57 | 58 | addons: 59 | apt: 60 | packages: 61 | - build-essential 62 | - git 63 | - libgnome-keyring-dev 64 | - fakeroot 65 | - libgconf-2-4 66 | 67 | stages: 68 | - test 69 | - name: release 70 | if: (NOT type = pull_request) AND branch = master 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | linter-jshint 2 | ========================= 3 | 4 | This plugin for [linter](https://github.com/atom-community/linter) provides an interface to [JSHint](http://www.jshint.com/docs/). It will lint JavaScript in files with the `.js` extension and optionally inside `