Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linter for courses #60

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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