├── .circleci
└── config.yml
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .remarkrc
├── .travis.yml
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── appveyor.yml
├── assets
└── screenshot.png
├── lib
└── index.js
├── package-lock.json
├── package.json
└── spec
├── .eslintrc.js
├── fixtures
├── definition-use-invalid.md
└── definition-use-valid.md
└── linter-markdown-spec.js
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | defaults: &defaults
4 | working_directory: /tmp/project
5 | docker:
6 | - image: arcanemagus/atom-docker-ci:stable
7 | steps:
8 | # Restore project state
9 | - attach_workspace:
10 | at: /tmp
11 | - run:
12 | name: Create VFB for Atom to run in
13 | command: /usr/local/bin/xvfb_start
14 | - run:
15 | name: Atom version
16 | command: ${ATOM_SCRIPT_PATH} --version
17 | - run:
18 | name: APM version
19 | command: ${APM_SCRIPT_PATH} --version
20 | - run:
21 | name: Package APM package dependencies
22 | command: |
23 | if [ -n "${APM_TEST_PACKAGES}" ]; then
24 | for pack in ${APM_TEST_PACKAGES}; do
25 | ${APM_SCRIPT_PATH} install "${pack}"
26 | done
27 | fi;
28 | - run:
29 | name: Package dependencies
30 | command: ${APM_SCRIPT_PATH} install
31 | - run:
32 | name: Cleaning package
33 | command: ${APM_SCRIPT_PATH} clean
34 | - run:
35 | name: Package specs
36 | command: ${ATOM_SCRIPT_PATH} --test spec
37 | # Cache node_modules
38 | - save_cache:
39 | paths:
40 | - node_modules
41 | key: v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
42 |
43 | jobs:
44 | checkout_code:
45 | <<: *defaults
46 | docker:
47 | - image: circleci/node:latest
48 | steps:
49 | - checkout
50 | # Restore node_modules from the last build
51 | - restore_cache:
52 | keys:
53 | # Get latest cache for this package.json and package-lock.json
54 | - v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
55 | # Fallback to the current package.json
56 | - v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-
57 | # Fallback to the last build for this branch
58 | - v1-dependencies-{{ .Branch }}-
59 | # Fallback to the last available master branch cache
60 | - v1-dependencies-master-
61 | # Don't go further down to prevent dependency issues from other branches
62 | # Save project state for next steps
63 | - persist_to_workspace:
64 | root: /tmp
65 | paths:
66 | - project
67 | lint:
68 | <<: *defaults
69 | docker:
70 | - image: circleci/node:latest
71 | steps:
72 | # Restore project state
73 | - attach_workspace:
74 | at: /tmp
75 | - run:
76 | name: Node.js Version
77 | command: node --version
78 | - run:
79 | name: NPM Version
80 | command: npm --version
81 | - run:
82 | name: Install any remaining dependencies
83 | command: npm ci
84 | - run:
85 | name: Lint code
86 | command: npm run lint
87 | stable:
88 | <<: *defaults
89 | beta:
90 | <<: *defaults
91 | docker:
92 | - image: arcanemagus/atom-docker-ci:beta
93 |
94 | workflows:
95 | version: 2
96 | test_package:
97 | jobs:
98 | - checkout_code
99 | - lint:
100 | requires:
101 | - checkout_code
102 | - stable:
103 | requires:
104 | - lint
105 | - beta:
106 | requires:
107 | - lint
108 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | # Change these settings to your own preference
10 | indent_style = space
11 | indent_size = 2
12 |
13 | # We recommend you to keep these unchanged
14 | end_of_line = lf
15 | charset = utf-8
16 | trim_trailing_whitespace = true
17 | insert_final_newline = true
18 |
19 | [*.md]
20 | trim_trailing_whitespace = false
21 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text eol=lf
3 |
4 | *.png binary
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | npm-debug.log
3 | node_modules
4 |
--------------------------------------------------------------------------------
/.remarkrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "preset-lint-recommended",
4 | "preset-lint-consistent"
5 | ],
6 | "settings": {
7 | "commonmark": true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | ### Project specific config ###
2 | language: node_js
3 | node_js: lts/*
4 | os: linux
5 |
6 | jobs:
7 | include:
8 | # Test PHP versions
9 | - stage: test
10 | env: ATOM_CHANNEL=stable
11 | - stage: test
12 | env: ATOM_CHANNEL=beta
13 |
14 | # Check the commit messages and run the extra lint script
15 | - stage: test
16 | language: node_js
17 | node_js: lts/*
18 | install:
19 | - npm install
20 | script:
21 | - npm run lint
22 | - commitlint-travis
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, so this must run in
27 | # the main language instead of Node.js.
28 | before_script:
29 | - export PATH=${PATH}:${HOME}/atom/usr/bin/
30 | deploy:
31 | provider: script
32 | skip_cleanup: true
33 | script:
34 | - npx semantic-release
35 |
36 | ### Generic setup follows ###
37 | script:
38 | - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
39 | - chmod u+x build-package.sh
40 | - "./build-package.sh"
41 |
42 | notifications:
43 | email:
44 | on_success: never
45 | on_failure: change
46 |
47 | branches:
48 | only:
49 | - master
50 | - "/^greenkeeper/.*$/"
51 |
52 | git:
53 | depth: 10
54 |
55 | sudo: false
56 |
57 | dist: trusty
58 |
59 | addons:
60 | apt:
61 | packages:
62 | - build-essential
63 | - git
64 | - libgnome-keyring-dev
65 | - fakeroot
66 |
67 | stages:
68 | - test
69 | - name: release
70 | if: (NOT type = pull_request) AND branch = master
71 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [5.2.11](https://github.com/AtomLinter/linter-markdown/compare/v5.2.10...v5.2.11) (2019-12-18)
2 |
3 |
4 | ### Bug Fixes
5 |
6 | * **deps:** update remark packages ([46c2e31](https://github.com/AtomLinter/linter-markdown/commit/46c2e31f8636ae2c81fdeb01afd6535080b64b1b))
7 |
8 | ## [5.2.10](https://github.com/AtomLinter/linter-markdown/compare/v5.2.9...v5.2.10) (2019-09-17)
9 |
10 |
11 | ### Bug Fixes
12 |
13 | * **deps:** update dependency unified-engine-atom to v8 ([5fa0623](https://github.com/AtomLinter/linter-markdown/commit/5fa0623))
14 | * **deps:** update remark packages ([30b3339](https://github.com/AtomLinter/linter-markdown/commit/30b3339))
15 |
16 | ## [5.2.9](https://github.com/AtomLinter/linter-markdown/compare/v5.2.8...v5.2.9) (2019-06-20)
17 |
18 |
19 | ### Bug Fixes
20 |
21 | * **deps:** update remark packages ([b706c66](https://github.com/AtomLinter/linter-markdown/commit/b706c66))
22 |
23 | ## [5.2.8](https://github.com/AtomLinter/linter-markdown/compare/v5.2.7...v5.2.8) (2019-06-17)
24 |
25 |
26 | ### Bug Fixes
27 |
28 | * **deps:** update dependency remark-frontmatter to v1.3.2 ([e2c81b4](https://github.com/AtomLinter/linter-markdown/commit/e2c81b4))
29 |
30 | ## [5.2.7](https://github.com/AtomLinter/linter-markdown/compare/v5.2.6...v5.2.7) (2019-04-22)
31 |
32 |
33 | ### Bug Fixes
34 |
35 | * **deps:** update dependency atom-package-deps to v5.1.0 ([1a78665](https://github.com/AtomLinter/linter-markdown/commit/1a78665))
36 |
37 | ## [5.2.6](https://github.com/AtomLinter/linter-markdown/compare/v5.2.5...v5.2.6) (2019-02-13)
38 |
39 |
40 | ### Bug Fixes
41 |
42 | * **deps:** update remark packages ([8ec6337](https://github.com/AtomLinter/linter-markdown/commit/8ec6337))
43 |
44 | ## [5.2.5](https://github.com/AtomLinter/linter-markdown/compare/v5.2.4...v5.2.5) (2019-02-13)
45 |
46 |
47 | ### Bug Fixes
48 |
49 | * **deps:** update dependency atom-package-deps to v5 ([73cb69b](https://github.com/AtomLinter/linter-markdown/commit/73cb69b))
50 |
51 | ## [5.2.4](https://github.com/AtomLinter/linter-markdown/compare/v5.2.3...v5.2.4) (2019-02-12)
52 |
53 |
54 | ### Bug Fixes
55 |
56 | * **deps:** update remark packages ([07d9656](https://github.com/AtomLinter/linter-markdown/commit/07d9656))
57 |
58 | ## [5.2.3](https://github.com/AtomLinter/linter-markdown/compare/v5.2.2...v5.2.3) (2019-02-12)
59 |
60 |
61 | ### Bug Fixes
62 |
63 | * **deps:** update dependency unified-engine-atom to v7.0.1 ([accd0ea](https://github.com/AtomLinter/linter-markdown/commit/accd0ea))
64 |
65 |
66 | ## [5.2.2](https://github.com/AtomLinter/linter-markdown/compare/v5.2.1...v5.2.2) (2018-05-10)
67 |
68 |
69 | ### Bug Fixes
70 |
71 | * **package:** update unified-engine-atom to version 7.0.0 ([81666fe](https://github.com/AtomLinter/linter-markdown/commit/81666fe))
72 |
73 |
74 | ## [5.2.1](https://github.com/AtomLinter/linter-markdown/compare/v5.2.0...v5.2.1) (2018-04-26)
75 |
76 |
77 | ### Bug Fixes
78 |
79 | * **package:** update remark to version 9.0.0 ([591cc5c](https://github.com/AtomLinter/linter-markdown/commit/591cc5c))
80 |
81 | # Change Log
82 |
83 | ## [v5.2.0](https://github.com/AtomLinter/linter-markdown/tree/v5.2.0) (2017-08-18)
84 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v5.1.0...v5.2.0)
85 |
86 | **Implemented enhancements:**
87 |
88 | - Add support for YAML frontmatter by default [\#149](https://github.com/AtomLinter/linter-markdown/pull/149) ([wooorm](https://github.com/wooorm))
89 |
90 | ## [v5.1.0](https://github.com/AtomLinter/linter-markdown/tree/v5.1.0) (2017-07-24)
91 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v5.0.0...v5.1.0)
92 |
93 | **Implemented enhancements:**
94 |
95 | - Update remark-preset-lint-markdown-style-guide to version 2.0.0 🚀 [\#147](https://github.com/AtomLinter/linter-markdown/pull/147) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
96 | - Update remark-preset-lint-recommended to version 3.0.0 🚀 [\#146](https://github.com/AtomLinter/linter-markdown/pull/146) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
97 | - Update eslint to version 4.0.0 🚀 [\#141](https://github.com/AtomLinter/linter-markdown/pull/141) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
98 |
99 | ## [v5.0.0](https://github.com/AtomLinter/linter-markdown/tree/v5.0.0) (2017-07-21)
100 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v4.1.0...v5.0.0)
101 |
102 | **Implemented enhancements:**
103 |
104 | - Update remark-cli to version 4.0.0 🚀 [\#145](https://github.com/AtomLinter/linter-markdown/pull/145) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
105 | - Update remark to version 8.0.0 🚀 [\#144](https://github.com/AtomLinter/linter-markdown/pull/144) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
106 |
107 | ## [v4.1.0](https://github.com/AtomLinter/linter-markdown/tree/v4.1.0) (2017-07-12)
108 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v4.0.1...v4.1.0)
109 |
110 | **Implemented enhancements:**
111 |
112 | - Global plugins and new preset [\#143](https://github.com/AtomLinter/linter-markdown/pull/143) ([wooorm](https://github.com/wooorm))
113 |
114 | **Fixed bugs:**
115 |
116 | - Update Atom minimum version [\#135](https://github.com/AtomLinter/linter-markdown/issues/135)
117 | - Cannot find module 'lint' \(with global remark-lint install\) [\#115](https://github.com/AtomLinter/linter-markdown/issues/115)
118 | - Update Travis-CI image to Trusty [\#137](https://github.com/AtomLinter/linter-markdown/pull/137) ([Arcanemagus](https://github.com/Arcanemagus))
119 | - Update minimum Atom version [\#136](https://github.com/AtomLinter/linter-markdown/pull/136) ([Arcanemagus](https://github.com/Arcanemagus))
120 |
121 | ## [v4.0.1](https://github.com/AtomLinter/linter-markdown/tree/v4.0.1) (2017-05-03)
122 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v4.0.0...v4.0.1)
123 |
124 | **Implemented enhancements:**
125 |
126 | - Update remark to v7.0.1 🚀 [\#133](https://github.com/AtomLinter/linter-markdown/pull/133) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
127 |
128 | ## [v4.0.0](https://github.com/AtomLinter/linter-markdown/tree/v4.0.0) (2017-04-14)
129 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v3.1.1...v4.0.0)
130 |
131 | **Implemented enhancements:**
132 |
133 | - chore\(package\): update atom-package-deps to version 4.6.0 [\#132](https://github.com/AtomLinter/linter-markdown/pull/132) ([Arcanemagus](https://github.com/Arcanemagus))
134 | - Update remark and linter [\#131](https://github.com/AtomLinter/linter-markdown/pull/131) ([wooorm](https://github.com/wooorm))
135 |
136 | ## [v3.1.1](https://github.com/AtomLinter/linter-markdown/tree/v3.1.1) (2017-04-12)
137 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v3.1.0...v3.1.1)
138 |
139 | **Implemented enhancements:**
140 |
141 | - Async-ify the specs [\#128](https://github.com/AtomLinter/linter-markdown/pull/128) ([Arcanemagus](https://github.com/Arcanemagus))
142 | - Defer dependency loading [\#127](https://github.com/AtomLinter/linter-markdown/pull/127) ([Arcanemagus](https://github.com/Arcanemagus))
143 | - Remove macOS testing [\#126](https://github.com/AtomLinter/linter-markdown/pull/126) ([Arcanemagus](https://github.com/Arcanemagus))
144 | - Update remark-cli to version 3.0.0 🚀 [\#122](https://github.com/AtomLinter/linter-markdown/pull/122) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
145 |
146 | **Fixed bugs:**
147 |
148 | - Minor fixes to callback handling [\#130](https://github.com/AtomLinter/linter-markdown/pull/130) ([Arcanemagus](https://github.com/Arcanemagus))
149 | - Cancel pending idle callbacks on deactivate [\#129](https://github.com/AtomLinter/linter-markdown/pull/129) ([Arcanemagus](https://github.com/Arcanemagus))
150 |
151 | ## [v3.1.0](https://github.com/AtomLinter/linter-markdown/tree/v3.1.0) (2017-01-25)
152 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v3.0.2...v3.1.0)
153 |
154 | **Implemented enhancements:**
155 |
156 | - Update dependencies to enable Greenkeeper 🌴 [\#119](https://github.com/AtomLinter/linter-markdown/pull/119) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
157 |
158 | ## [v3.0.2](https://github.com/AtomLinter/linter-markdown/tree/v3.0.2) (2016-09-21)
159 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v3.0.1...v3.0.2)
160 |
161 | **Implemented enhancements:**
162 |
163 | - eslint-config-airbnb-base@7.1.0 [\#111](https://github.com/AtomLinter/linter-markdown/pull/111) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
164 |
165 | **Fixed bugs:**
166 |
167 | - \[Package-Deps\] Unable to get loaded package 'linter-markdown' [\#112](https://github.com/AtomLinter/linter-markdown/issues/112)
168 | - Specify to auto-install Linter [\#113](https://github.com/AtomLinter/linter-markdown/pull/113) ([Arcanemagus](https://github.com/Arcanemagus))
169 |
170 | ## [v3.0.1](https://github.com/AtomLinter/linter-markdown/tree/v3.0.1) (2016-09-07)
171 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v3.0.0...v3.0.1)
172 |
173 | **Implemented enhancements:**
174 |
175 | - Update eslint-config-airbnb-base to version 7.0.0 🚀 [\#109](https://github.com/AtomLinter/linter-markdown/pull/109) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
176 | - Update remark to version 6.0.1 🚀 [\#107](https://github.com/AtomLinter/linter-markdown/pull/107) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
177 |
178 | ## [v3.0.0](https://github.com/AtomLinter/linter-markdown/tree/v3.0.0) (2016-09-02)
179 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v2.0.1...v3.0.0)
180 |
181 | **Implemented enhancements:**
182 |
183 | - Support presets [\#103](https://github.com/AtomLinter/linter-markdown/issues/103)
184 | - Add support for presets [\#106](https://github.com/AtomLinter/linter-markdown/pull/106) ([wooorm](https://github.com/wooorm))
185 | - Update remark-lint to version 4.2.0 🚀 [\#96](https://github.com/AtomLinter/linter-markdown/pull/96) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
186 |
187 | **Closed issues:**
188 |
189 | - linter-markdown not respecting .remarkrc [\#102](https://github.com/AtomLinter/linter-markdown/issues/102)
190 | - configuration comments no longer work [\#97](https://github.com/AtomLinter/linter-markdown/issues/97)
191 |
192 | ## [v2.0.1](https://github.com/AtomLinter/linter-markdown/tree/v2.0.1) (2016-08-12)
193 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v2.0.0...v2.0.1)
194 |
195 | **Fixed bugs:**
196 |
197 | - Uncaught TypeError: Cannot convert undefined or null to object [\#94](https://github.com/AtomLinter/linter-markdown/issues/94)
198 |
199 | ## [v2.0.0](https://github.com/AtomLinter/linter-markdown/tree/v2.0.0) (2016-08-10)
200 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.5.2...v2.0.0)
201 |
202 | **Implemented enhancements:**
203 |
204 | - Local version of remark-lint [\#71](https://github.com/AtomLinter/linter-markdown/issues/71)
205 | - Add support for ignore files, local remark-lint [\#85](https://github.com/AtomLinter/linter-markdown/pull/85) ([wooorm](https://github.com/wooorm))
206 | - Update remark-lint to version 4.0.2 🚀 [\#81](https://github.com/AtomLinter/linter-markdown/pull/81) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
207 | - Update remark-lint to version 4.0.1 🚀 [\#74](https://github.com/AtomLinter/linter-markdown/pull/74) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
208 | - Pin remark and remark-lint versions [\#67](https://github.com/AtomLinter/linter-markdown/pull/67) ([Arcanemagus](https://github.com/Arcanemagus))
209 |
210 | **Fixed bugs:**
211 |
212 | - Uncaught Error: Cannot read configuration file: /Users/tymen/package.jsonEISDIR: illegal operati... [\#83](https://github.com/AtomLinter/linter-markdown/issues/83)
213 | - "Uncaught SyntaxError: Cannot read configuration file" when invalid syntax [\#76](https://github.com/AtomLinter/linter-markdown/issues/76)
214 |
215 | **Closed issues:**
216 |
217 | - Support validate-links [\#69](https://github.com/AtomLinter/linter-markdown/issues/69)
218 | - Uncaught SyntaxError: Cannot read configuration file: /Users/nonameolsson/Development/smpw/packag... [\#68](https://github.com/AtomLinter/linter-markdown/issues/68)
219 |
220 | ## [v1.5.2](https://github.com/AtomLinter/linter-markdown/tree/v1.5.2) (2016-05-26)
221 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.5.1...v1.5.2)
222 |
223 | **Closed issues:**
224 |
225 | - Uncaught TypeError: Cannot read property 'external' of undefined [\#65](https://github.com/AtomLinter/linter-markdown/issues/65)
226 |
227 | ## [v1.5.1](https://github.com/AtomLinter/linter-markdown/tree/v1.5.1) (2016-05-26)
228 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.5.0...v1.5.1)
229 |
230 | **Implemented enhancements:**
231 |
232 | - Update eslint-config-airbnb-base to version 3.0.1 🚀 [\#64](https://github.com/AtomLinter/linter-markdown/pull/64) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
233 | - Move to eslint-config-airbnb-base [\#61](https://github.com/AtomLinter/linter-markdown/pull/61) ([Arcanemagus](https://github.com/Arcanemagus))
234 | - eslint-config-airbnb@6.2.0 [\#54](https://github.com/AtomLinter/linter-markdown/pull/54) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
235 |
236 | **Closed issues:**
237 |
238 | - Uncaught Error: Cannot find module 'remark-lint-no-empty-sections' [\#51](https://github.com/AtomLinter/linter-markdown/issues/51)
239 |
240 | **Merged pull requests:**
241 |
242 | - eslint@2.4.0 breaks build 🚨 [\#53](https://github.com/AtomLinter/linter-markdown/pull/53) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
243 | - Update eslint to version 2.2.0 🚀 [\#47](https://github.com/AtomLinter/linter-markdown/pull/47) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
244 | - Update babel-eslint to version 5.0.0 🚀 [\#46](https://github.com/AtomLinter/linter-markdown/pull/46) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
245 | - Update atom-package-deps to version 4.0.1 🚀 [\#45](https://github.com/AtomLinter/linter-markdown/pull/45) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
246 |
247 | ## [v1.5.0](https://github.com/AtomLinter/linter-markdown/tree/v1.5.0) (2016-02-15)
248 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.4.2...v1.5.0)
249 |
250 | **Implemented enhancements:**
251 |
252 | - Update remark to version 4.0.0 🚀 [\#42](https://github.com/AtomLinter/linter-markdown/pull/42) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
253 | - Update remark-lint to version 3.0.0 🚀 [\#41](https://github.com/AtomLinter/linter-markdown/pull/41) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
254 | - improve startup time [\#38](https://github.com/AtomLinter/linter-markdown/pull/38) ([dirk-thomas](https://github.com/dirk-thomas))
255 |
256 | **Closed issues:**
257 |
258 | - Uncaught SyntaxError: Cannot read configuration file: /Users/mglaman/Projects/ng-github/package.j... [\#39](https://github.com/AtomLinter/linter-markdown/issues/39)
259 | - Allow Tabs? [\#37](https://github.com/AtomLinter/linter-markdown/issues/37)
260 |
261 | ## [v1.4.2](https://github.com/AtomLinter/linter-markdown/tree/v1.4.2) (2016-02-04)
262 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.4.1...v1.4.2)
263 |
264 | ## [v1.4.1](https://github.com/AtomLinter/linter-markdown/tree/v1.4.1) (2016-02-04)
265 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.4.0...v1.4.1)
266 |
267 | ## [v1.4.0](https://github.com/AtomLinter/linter-markdown/tree/v1.4.0) (2016-02-04)
268 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.3.0...v1.4.0)
269 |
270 | **Implemented enhancements:**
271 |
272 | - Update eslint-config-airbnb to version 5.0.0 🚀 [\#36](https://github.com/AtomLinter/linter-markdown/pull/36) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
273 | - Update eslint-config-airbnb to version 4.0.0 🚀 [\#35](https://github.com/AtomLinter/linter-markdown/pull/35) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
274 | - remark-lint@2.2.1 [\#33](https://github.com/AtomLinter/linter-markdown/pull/33) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
275 | - Update eslint-config-airbnb to version 3.0.0 🚀 [\#28](https://github.com/AtomLinter/linter-markdown/pull/28) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
276 |
277 | **Closed issues:**
278 |
279 | - Customise default lint rules [\#31](https://github.com/AtomLinter/linter-markdown/issues/31)
280 | - Atom linter not using configuration from ~/.remarkrc [\#29](https://github.com/AtomLinter/linter-markdown/issues/29)
281 | - Add support for `mdastConfig` in package.json [\#18](https://github.com/AtomLinter/linter-markdown/issues/18)
282 |
283 | ## [v1.3.0](https://github.com/AtomLinter/linter-markdown/tree/v1.3.0) (2015-12-29)
284 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.2.4...v1.3.0)
285 |
286 | **Implemented enhancements:**
287 |
288 | - Automatically install linter [\#26](https://github.com/AtomLinter/linter-markdown/pull/26) ([Arcanemagus](https://github.com/Arcanemagus))
289 |
290 | **Closed issues:**
291 |
292 | - Add specs [\#13](https://github.com/AtomLinter/linter-markdown/issues/13)
293 | - Install `linter` automatically. [\#6](https://github.com/AtomLinter/linter-markdown/issues/6)
294 |
295 | **Merged pull requests:**
296 |
297 | - Add some repository configuration files [\#27](https://github.com/AtomLinter/linter-markdown/pull/27) ([Arcanemagus](https://github.com/Arcanemagus))
298 | - Fix the linter name [\#25](https://github.com/AtomLinter/linter-markdown/pull/25) ([Arcanemagus](https://github.com/Arcanemagus))
299 | - Add specs [\#24](https://github.com/AtomLinter/linter-markdown/pull/24) ([Arcanemagus](https://github.com/Arcanemagus))
300 | - Add lint config [\#23](https://github.com/AtomLinter/linter-markdown/pull/23) ([Arcanemagus](https://github.com/Arcanemagus))
301 | - Switch to js [\#21](https://github.com/AtomLinter/linter-markdown/pull/21) ([wooorm](https://github.com/wooorm))
302 | - Update remark [\#20](https://github.com/AtomLinter/linter-markdown/pull/20) ([wooorm](https://github.com/wooorm))
303 | - Add badges for CI, deps, and pkg info [\#17](https://github.com/AtomLinter/linter-markdown/pull/17) ([SpainTrain](https://github.com/SpainTrain))
304 | - Lint markdown files with mdast [\#16](https://github.com/AtomLinter/linter-markdown/pull/16) ([SpainTrain](https://github.com/SpainTrain))
305 |
306 | ## [v1.2.4](https://github.com/AtomLinter/linter-markdown/tree/v1.2.4) (2015-12-10)
307 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.2.3...v1.2.4)
308 |
309 | **Merged pull requests:**
310 |
311 | - Add linter name [\#15](https://github.com/AtomLinter/linter-markdown/pull/15) ([Arcanemagus](https://github.com/Arcanemagus))
312 | - Add CirclCI, TravisCI, and Appveyor configs [\#14](https://github.com/AtomLinter/linter-markdown/pull/14) ([SpainTrain](https://github.com/SpainTrain))
313 | - Add `text.md` scope [\#12](https://github.com/AtomLinter/linter-markdown/pull/12) ([SpainTrain](https://github.com/SpainTrain))
314 |
315 | ## [v1.2.3](https://github.com/AtomLinter/linter-markdown/tree/v1.2.3) (2015-12-09)
316 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.2.2...v1.2.3)
317 |
318 | **Fixed bugs:**
319 |
320 | - Uncaught TypeError: callback is not a function [\#10](https://github.com/AtomLinter/linter-markdown/issues/10)
321 |
322 | **Closed issues:**
323 |
324 | - Linting Entire Markdown File as Bash [\#7](https://github.com/AtomLinter/linter-markdown/issues/7)
325 |
326 | **Merged pull requests:**
327 |
328 | - Fix mdast update [\#11](https://github.com/AtomLinter/linter-markdown/pull/11) ([wooorm](https://github.com/wooorm))
329 |
330 | ## [v1.2.2](https://github.com/AtomLinter/linter-markdown/tree/v1.2.2) (2015-12-09)
331 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.2.1...v1.2.2)
332 |
333 | **Closed issues:**
334 |
335 | - Update mdast [\#8](https://github.com/AtomLinter/linter-markdown/issues/8)
336 |
337 | **Merged pull requests:**
338 |
339 | - Update all dependencies 🌴 [\#9](https://github.com/AtomLinter/linter-markdown/pull/9) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
340 |
341 | ## [v1.2.1](https://github.com/AtomLinter/linter-markdown/tree/v1.2.1) (2015-09-03)
342 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.2.0...v1.2.1)
343 |
344 | **Closed issues:**
345 |
346 | - Replace tilde \(`~`\) with caret \(`^`\) for mdast, mdast-lint [\#4](https://github.com/AtomLinter/linter-markdown/issues/4)
347 |
348 | ## [v1.2.0](https://github.com/AtomLinter/linter-markdown/tree/v1.2.0) (2015-09-01)
349 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.1.0...v1.2.0)
350 |
351 | ## [v1.1.0](https://github.com/AtomLinter/linter-markdown/tree/v1.1.0) (2015-08-29)
352 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v1.0.0...v1.1.0)
353 |
354 | **Closed issues:**
355 |
356 | - Add support for reloading `.mdastrc` config [\#3](https://github.com/AtomLinter/linter-markdown/issues/3)
357 | - Reference configuration section of mdast-lint [\#2](https://github.com/AtomLinter/linter-markdown/issues/2)
358 | - SyntaxError on empty `.mdastrc` [\#1](https://github.com/AtomLinter/linter-markdown/issues/1)
359 |
360 | ## [v1.0.0](https://github.com/AtomLinter/linter-markdown/tree/v1.0.0) (2015-08-29)
361 | [Full Changelog](https://github.com/AtomLinter/linter-markdown/compare/v0.1.0...v1.0.0)
362 |
363 | ## [v0.1.0](https://github.com/AtomLinter/linter-markdown/tree/v0.1.0) (2015-08-03)
364 |
365 |
366 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
367 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Lukas Eipert
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # linter-markdown
2 |
3 | [](https://travis-ci.org/AtomLinter/linter-markdown)
4 | [](https://circleci.com/gh/AtomLinter/linter-markdown/tree/master)
5 | [](https://ci.appveyor.com/project/SpainTrain/linter-markdown/branch/master)
6 |
7 | [](https://www.bithound.io/github/AtomLinter/linter-markdown)
8 | [](https://www.bithound.io/github/AtomLinter/linter-markdown/master/dependencies/npm)
9 | [](https://atom.io/packages/linter-markdown)
10 | [](https://atom.io/packages/linter-markdown)
11 |
12 | Lint markdown files using [remark-lint][remark-lint] and the
13 | [linter][linter] package for atom.
14 |
15 | If there is no configuration found for **remark-lint**, this linter runs [remark-preset-lint-consistent][consistent] and
16 | [remark-preset-lint-recommended][recommended] (both can be turned off).
17 | You can a also turn on [remark-preset-lint-markdown-style-guide][styleguide].
18 | By default, [YAML frontmatter][yaml] is supported, but you can turn that off.
19 |
20 | If there *is* configuration for **remark-lint**, through `.remarkrc` files
21 | or `remarkConfig` in `package.json`s, this linter works just like
22 | [remark-cli][cli].
23 |
24 | You should probably install modules referenced in `.remarkrc` files locally
25 | (`npm install` without the `-g` or `--global` flag). If you do install modules
26 | globally, you must either use [nvm][], or have
27 | a [`prefix` in your `.npmrc`][prefix].
28 |
29 | See [this tutorial][set-up] on how to set-up npm to work without sudo, which
30 | is good practise, and comes with the added benefit that `linter-markdown`
31 | can pick up on globally installed modules.
32 |
33 | Read more about configuring [remark-lint][configuration] on its README.
34 |
35 | A similar linter, [linter-remark][], runs all remark plugins, but only
36 | when they are configured to run.
37 |
38 | We also maintain a [changelog][changelog] containing recent changes.
39 |
40 | ![Screenshot of linter-markdown in action][screenshot]
41 |
42 | [remark-lint]: https://github.com/wooorm/remark-lint
43 | [changelog]: https://github.com/AtomLinter/linter-markdown/blob/master/CHANGELOG.md
44 | [configuration]: https://github.com/wooorm/remark-lint#configuring-remark-lint
45 | [linter]: https://atom.io/packages/linter
46 | [screenshot]: https://raw.githubusercontent.com/AtomLinter/linter-markdown/master/assets/screenshot.png
47 | [cli]: https://github.com/wooorm/remark/tree/master/packages/remark-cli
48 | [yaml]: https://github.com/wooorm/remark-frontmatter
49 | [consistent]: https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-consistent
50 | [recommended]: https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-recommended
51 | [styleguide]: https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide
52 | [linter-remark]: https://github.com/wooorm/linter-remark
53 | [nvm]: https://github.com/creationix/nvm
54 | [prefix]: https://docs.npmjs.com/misc/config#prefix
55 | [set-up]: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
56 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | ### Project specific config ###
2 | environment:
3 | APM_TEST_PACKAGES:
4 | ATOM_LINT_WITH_BUNDLED_NODE: "false"
5 |
6 | matrix:
7 | - ATOM_CHANNEL: stable
8 | - ATOM_CHANNEL: beta
9 |
10 | install:
11 | # Install Node.js to run any configured linters
12 | - ps: Install-Product node 10
13 |
14 | ### Generic setup follows ###
15 | build_script:
16 | - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1'))
17 |
18 | branches:
19 | only:
20 | - master
21 |
22 | version: "{build}"
23 | platform: x64
24 | clone_depth: 10
25 | skip_tags: true
26 | test: off
27 | deploy: off
28 |
--------------------------------------------------------------------------------
/assets/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AtomLinter/linter-markdown/6ebdc7e2392c75ee6020c579dad7431c81750a79/assets/screenshot.png
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use babel';
2 |
3 | /**
4 | * @author Titus Wormer
5 | * @copyright 2015 Titus Wormer
6 | * @license MIT
7 | * @module atom:linter-markdown
8 | * @fileoverview Linter.
9 | */
10 |
11 | // eslint-disable-next-line import/no-extraneous-dependencies, import/extensions
12 | import { CompositeDisposable } from 'atom';
13 |
14 | // Internal variables
15 | let engine;
16 | let processor;
17 | let subscriptions;
18 | let yamlWithoutConfig;
19 | let recommendedWithoutConfig;
20 | let consistentWithoutConfig;
21 | let styleGuideWithoutConfig;
22 | let frontmatter;
23 | let recommended;
24 | let consistent;
25 | let styleGuide;
26 | const idleCallbacks = new Set();
27 |
28 | // Settings
29 | let scopes;
30 | let detectIgnore;
31 |
32 | function loadDeps() {
33 | if (!engine) {
34 | engine = require('unified-engine-atom');
35 | }
36 | if (!processor) {
37 | processor = require('remark');
38 | }
39 | if (!frontmatter) {
40 | frontmatter = require('remark-frontmatter');
41 | }
42 | if (!recommended) {
43 | recommended = require('remark-preset-lint-recommended');
44 | }
45 | if (!styleGuide) {
46 | styleGuide = require('remark-preset-lint-markdown-style-guide');
47 | }
48 | if (!consistent) {
49 | consistent = require('remark-preset-lint-consistent');
50 | }
51 | }
52 |
53 | function lint(editor) {
54 | const plugins = [];
55 | let defaultConfig;
56 |
57 | // Load required modules if not already handled by init
58 | loadDeps();
59 |
60 | if (yamlWithoutConfig) {
61 | plugins.push(frontmatter);
62 | }
63 |
64 | if (recommendedWithoutConfig) {
65 | plugins.push(recommended);
66 | }
67 |
68 | if (styleGuideWithoutConfig) {
69 | plugins.push(styleGuide);
70 | }
71 |
72 | if (consistentWithoutConfig) {
73 | plugins.push(consistent);
74 | }
75 |
76 | if (
77 | yamlWithoutConfig
78 | || consistentWithoutConfig
79 | || recommendedWithoutConfig
80 | || styleGuideWithoutConfig
81 | ) {
82 | defaultConfig = { plugins };
83 | }
84 |
85 | return engine({
86 | processor,
87 | detectIgnore,
88 | defaultConfig,
89 | rcName: '.remarkrc',
90 | packageField: 'remarkConfig',
91 | ignoreName: '.remarkignore',
92 | pluginPrefix: 'remark'
93 | })(editor);
94 | }
95 |
96 | /**
97 | * Linter-markdown.
98 | *
99 | * @return {LinterConfiguration}
100 | */
101 | function provideLinter() {
102 | return {
103 | grammarScopes: scopes,
104 | name: 'remark-lint',
105 | scope: 'file',
106 | lintsOnChange: true,
107 | lint
108 | };
109 | }
110 |
111 | function activate() {
112 | let callbackID;
113 | const installLinterMarkdownDeps = () => {
114 | idleCallbacks.delete(callbackID);
115 |
116 | // Install package dependencies
117 | if (!atom.inSpecMode()) {
118 | require('atom-package-deps').install('linter-markdown');
119 | }
120 | // Load required modules
121 | loadDeps();
122 | };
123 |
124 | // Defer this till an idle time as we don't need it immediately
125 | callbackID = window.requestIdleCallback(installLinterMarkdownDeps);
126 | idleCallbacks.add(callbackID);
127 |
128 | subscriptions = new CompositeDisposable();
129 |
130 | subscriptions.add(atom.config.observe('linter-markdown.yamlWithoutConfig', (value) => {
131 | yamlWithoutConfig = value;
132 | }));
133 | subscriptions.add(atom.config.observe('linter-markdown.presetRecommendedWithoutConfig', (value) => {
134 | recommendedWithoutConfig = value;
135 | }));
136 | subscriptions.add(atom.config.observe('linter-markdown.presetConsistentWithoutConfig', (value) => {
137 | consistentWithoutConfig = value;
138 | }));
139 | subscriptions.add(atom.config.observe('linter-markdown.presetStyleGuideWithoutConfig', (value) => {
140 | styleGuideWithoutConfig = value;
141 | }));
142 | subscriptions.add(atom.config.observe('linter-markdown.scopes', (value) => {
143 | scopes = value;
144 | }));
145 | subscriptions.add(atom.config.observe('linter-markdown.detectIgnore', (value) => {
146 | detectIgnore = value;
147 | }));
148 | }
149 |
150 | function deactivate() {
151 | idleCallbacks.forEach((callbackID) => window.cancelIdleCallback(callbackID));
152 | idleCallbacks.clear();
153 | subscriptions.dispose();
154 | }
155 |
156 | /*
157 | * Expose.
158 | */
159 | module.exports = {
160 | activate,
161 | deactivate,
162 | provideLinter
163 | };
164 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "linter-markdown",
3 | "main": "lib/index.js",
4 | "version": "5.2.11",
5 | "description": "Lint markdown on the fly, using remark-lint",
6 | "scripts": {
7 | "lint": "remark README.md LICENSE.md && eslint lib spec",
8 | "test": "apm test"
9 | },
10 | "keywords": [
11 | "lint",
12 | "linter",
13 | "remark",
14 | "remark-lint",
15 | "markdown"
16 | ],
17 | "repository": {
18 | "type": "git",
19 | "url": "https://github.com/AtomLinter/linter-markdown.git"
20 | },
21 | "license": "MIT",
22 | "engines": {
23 | "atom": ">=1.7.0 <2.0.0"
24 | },
25 | "package-deps": [
26 | "linter"
27 | ],
28 | "dependencies": {
29 | "atom-package-deps": "5.1.0",
30 | "remark": "11.0.2",
31 | "remark-frontmatter": "1.3.2",
32 | "remark-preset-lint-consistent": "2.0.3",
33 | "remark-preset-lint-markdown-style-guide": "2.1.3",
34 | "remark-preset-lint-recommended": "3.0.3",
35 | "unified-engine-atom": "8.0.0"
36 | },
37 | "devDependencies": {
38 | "@commitlint/cli": "8.3.5",
39 | "@commitlint/config-conventional": "8.3.4",
40 | "@commitlint/travis-cli": "8.3.5",
41 | "@semantic-release/apm-config": "8.0.0",
42 | "eslint": "6.8.0",
43 | "eslint-config-airbnb-base": "14.0.0",
44 | "eslint-plugin-import": "2.20.1",
45 | "husky": "4.2.3",
46 | "jasmine-fix": "1.3.1",
47 | "remark-cli": "7.0.1",
48 | "semantic-release": "17.0.4"
49 | },
50 | "eslintConfig": {
51 | "rules": {
52 | "comma-dangle": [
53 | "error",
54 | "never"
55 | ],
56 | "global-require": "off",
57 | "no-console": "off",
58 | "import/no-unresolved": [
59 | "error",
60 | {
61 | "ignore": [
62 | "atom"
63 | ]
64 | }
65 | ]
66 | },
67 | "extends": "airbnb-base",
68 | "globals": {
69 | "atom": true
70 | },
71 | "env": {
72 | "node": true,
73 | "browser": true
74 | }
75 | },
76 | "providedServices": {
77 | "linter": {
78 | "versions": {
79 | "2.0.0": "provideLinter"
80 | }
81 | }
82 | },
83 | "configSchema": {
84 | "detectIgnore": {
85 | "title": "Ignore files",
86 | "description": "Use `.remarkignore` files.",
87 | "type": "boolean",
88 | "default": true
89 | },
90 | "yamlWithoutConfig": {
91 | "title": "Support YAML frontmatter",
92 | "description": "Support YAML [frontmatter](https://github.com/wooorm/remark-frontmatter) if no **remark-lint** config is found.",
93 | "type": "boolean",
94 | "default": true
95 | },
96 | "presetRecommendedWithoutConfig": {
97 | "title": "Bug-free by default",
98 | "description": "Use [remark-preset-lint-recommended](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-recommended) if no **remark-lint** config is found.",
99 | "type": "boolean",
100 | "default": true
101 | },
102 | "presetConsistentWithoutConfig": {
103 | "title": "Consistency by default",
104 | "description": "Use [remark-preset-lint-consistent](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-consistent) if no **remark-lint** config is found.",
105 | "type": "boolean",
106 | "default": true
107 | },
108 | "presetStyleGuideWithoutConfig": {
109 | "title": "Strict markdown style guide by default",
110 | "description": "Use [remark-preset-lint-markdown-style-guide](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide) if no **remark-lint** config is found.",
111 | "type": "boolean",
112 | "default": false
113 | },
114 | "scopes": {
115 | "title": "Scopes",
116 | "description": "List of scopes for languages which will be checked (run `Editor: Log Cursor Scope` to determine the scopes for a file).",
117 | "type": "array",
118 | "items": {
119 | "type": "string"
120 | },
121 | "default": [
122 | "source.gfm",
123 | "source.pfm",
124 | "text.md"
125 | ]
126 | }
127 | },
128 | "renovate": {
129 | "extends": [
130 | "config:base"
131 | ],
132 | "semanticCommits": true,
133 | "rangeStrategy": "pin",
134 | "packageRules": [
135 | {
136 | "packagePatterns": [
137 | "^eslint"
138 | ],
139 | "groupName": "ESLint packages"
140 | },
141 | {
142 | "packagePatterns": [
143 | "^remark"
144 | ],
145 | "groupName": "Remark packages"
146 | }
147 | ]
148 | },
149 | "release": {
150 | "extends": "@semantic-release/apm-config"
151 | },
152 | "husky": {
153 | "hooks": {
154 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
155 | }
156 | },
157 | "commitlint": {
158 | "extends": [
159 | "@commitlint/config-conventional"
160 | ]
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/spec/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | atomtest: true,
4 | jasmine: true
5 | }
6 | };
7 |
--------------------------------------------------------------------------------
/spec/fixtures/definition-use-invalid.md:
--------------------------------------------------------------------------------
1 | This document has definitions with improper spacing and casing.
2 |
3 | [Invalid]: http://example.com/favicon.ico "Example Domain"
4 |
--------------------------------------------------------------------------------
/spec/fixtures/definition-use-valid.md:
--------------------------------------------------------------------------------
1 | This [document][valid] has definitions with proper spacing and casing.
2 |
3 | [valid]: http://example.com/favicon.ico "Example Domain"
4 |
--------------------------------------------------------------------------------
/spec/linter-markdown-spec.js:
--------------------------------------------------------------------------------
1 | 'use babel';
2 |
3 | import * as path from 'path';
4 | // eslint-disable-next-line import/no-extraneous-dependencies
5 | import { beforeEach, it } from 'jasmine-fix';
6 | // NOTE: If using fit you must add it to the list above!
7 |
8 | import * as lint from '..';
9 |
10 | const validPath = path.join(__dirname, 'fixtures', 'definition-use-valid.md');
11 | const invalidPath = path.join(__dirname, 'fixtures', 'definition-use-invalid.md');
12 |
13 | describe('The remark-lint provider for Linter', () => {
14 | beforeEach(async () => {
15 | atom.workspace.destroyActivePaneItem();
16 | await atom.packages.activatePackage('linter-markdown');
17 | await atom.packages.activatePackage('language-gfm');
18 | });
19 |
20 | describe('checks a file with issues and', () => {
21 | let editor = null;
22 | beforeEach(async () => {
23 | editor = await atom.workspace.open(invalidPath);
24 | });
25 |
26 | it('finds at least one message', async () => {
27 | const messages = await lint.provideLinter().lint(editor);
28 | expect(messages.length).toBeGreaterThan(0);
29 | });
30 |
31 | it('verifies the first message', async () => {
32 | const messages = await lint.provideLinter().lint(editor);
33 | expect(messages[0].severity).toBe('warning');
34 | expect(messages[0].location.file).toBe(invalidPath);
35 | expect(messages[0].location.position).toEqual([[2, 0], [2, 58]]);
36 | expect(messages[0].description).not.toBeDefined();
37 | expect(messages[0].excerpt).toBe('Found unused definition (remark-lint:no-unused-definitions)');
38 | });
39 | });
40 |
41 | it('finds nothing wrong with a valid file', async () => {
42 | const editor = await atom.workspace.open(validPath);
43 | const messages = await lint.provideLinter().lint(editor);
44 | expect(messages.length).toBe(0);
45 | });
46 | });
47 |
--------------------------------------------------------------------------------