Skip to content

Commit

Permalink
Version 1.0.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Toliak committed Aug 7, 2022
1 parent 8a23368 commit f2a0781
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const processor = require('./processor');

module.exports.processors = {
/** @type require("@types/eslint").Linter.Processor */
".yaxm": {
'.yaxm': {
preprocess: function () {
return [];
},
Expand Down
13 changes: 10 additions & 3 deletions lib/processor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const converter = require('@md-to-latex/converter');
const diagnose = require('@md-to-latex/converter/dist/diagnose');
const latexPrinter = require('@md-to-latex/converter/dist/printer/latex');
const path = require('path');
const yaml = require('js-yaml');
const fs = require('fs');

/**
*
Expand All @@ -15,8 +15,15 @@ function __getFileDiagnosticList(filepath) {
const originalFilepath = path.resolve(filepath);
const rootDir = path.resolve('.');

const buildConfig = yaml.load(fs.readFileSync('yaxm-build.yml', 'utf-8'));
const result = converter.convertYaxmFiles({
rootDir: rootDir,
buildConfig: buildConfig,
});

/** @type converter.DiagnoseList */
const diagnostic = converter.convertMarkdownFiles(rootDir, true);
const diagnostic = result.diagnostic;

return diagnostic.filter(
d => path.resolve(d.filePath) === originalFilepath,
);
Expand Down
35 changes: 13 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-yaxm",
"version": "1.0.0",
"version": "1.0.0-beta.0",
"description": "ESLint plugin for YAXM",
"keywords": [
"eslint",
Expand All @@ -25,7 +25,8 @@
"prettier": "^2.7.1"
},
"dependencies": {
"@md-to-latex/converter": "^2.0.0-beta.3"
"@md-to-latex/converter": "^2.0.0-beta.4",
"js-yaml": "^4.1.0"
},
"engines": {
"node": "12.x || 14.x || >= 16"
Expand Down

0 comments on commit f2a0781

Please sign in to comment.