Skip to content

Commit

Permalink
Merge pull request #60 from Hexlet/courses-lint
Browse files Browse the repository at this point in the history
add linter for courses
  • Loading branch information
dzencot authored Aug 30, 2024
2 parents 9933daf + 7ff5003 commit ebd2bea
Show file tree
Hide file tree
Showing 5 changed files with 11,233 additions and 22,435 deletions.
6 changes: 6 additions & 0 deletions course.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ translations-write:
markdown-lint:
npx markdownlint -c ../../../.markdownlint.json ${CURDIR}

lint:
npx eslint -c ${ROOT_DIR}/eslint.config.js ${CURDIR}

markdown-lint-fix:
npx markdownlint -f -c ../../../.markdownlint.json ${CURDIR}

lint-fix:
npx eslint -c ${ROOT_DIR}/eslint.config.js ${CURDIR} --fix

spellcheck:
docker run --rm -v ./:/content hexlet/languagetool-cli node ./bin/run.js check /content/**/*.md

Expand Down
2 changes: 1 addition & 1 deletion docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ markdown-lint-fix:
npx markdownlint -f -c ../../../../.markdownlint.json ${CURDIR}

spellcheck:
docker run --rm -v ./:/content hexlet/languagetool-cli node ./bin/run.js check /content/**/*.md
docker run --rm -v ./:/content ghcr.io/hexlet/languagetool-cli node ./bin/run.js check /content/**/*.md
31 changes: 31 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import stylistic from '@stylistic/eslint-plugin';
import globals from 'globals';
import pluginJs from '@eslint/js';
import markdown from '@eslint/markdown';

export default [
pluginJs.configs.recommended,
stylistic.configs['recommended-flat'],
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
...globals.jest,
},
},
plugins: {
'@stylistic': stylistic,
},
rules: {
'@stylistic/semi': ['error', 'always'],
},
},
{
files: ['**/*.md'],
plugins: {
markdown,
},
processor: 'markdown/markdown',
},
];
Loading

0 comments on commit ebd2bea

Please sign in to comment.