Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const assert = require('node:assert/strict');
const { describe, it } = require('node:test');
const { TextlintKernel } = require('@textlint/kernel');
const markdownPlugin = require('@textlint/textlint-plugin-markdown').default;
const commentsFilter = require('textlint-filter-rule-comments');
const preset = require('../index.js');
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { TextlintKernel } from '@textlint/kernel';
import textlintPluginMarkdown from '@textlint/textlint-plugin-markdown';
import commentsFilter from 'textlint-filter-rule-comments';
import preset from '../index.js';

const markdownPlugin = textlintPluginMarkdown.default;

/**
* Lints markdown with the preset's terminology rule and its comment filter enabled,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const assert = require('node:assert/strict');
const { describe, it } = require('node:test');
const { TextlintKernel } = require('@textlint/kernel');
const textPlugin = require('@textlint/textlint-plugin-text').default;
const preset = require('../index.js');
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { TextlintKernel } from '@textlint/kernel';
import textlintPluginText from '@textlint/textlint-plugin-text';
import preset from '../index.js';

const textPlugin = textlintPluginText.default;

/**
* Lints text with only the preset's terminology rule enabled.
Expand Down
23 changes: 13 additions & 10 deletions packages/textlint-rule-preset-alma/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
const stopwords = require('textlint-rule-stop-words');
const misspellings = require('textlint-rule-common-misspellings').default;
const writegood = require('textlint-rule-write-good').default;
const titlecase = require('textlint-rule-title-case');
const apostrophe = require('textlint-rule-apostrophe');
const terminology = require('./rules/terminology');
import textlintRuleStopWords from 'textlint-rule-stop-words';
import textlintRuleCommonMisspellings from 'textlint-rule-common-misspellings';
import textlintRuleWriteGood from 'textlint-rule-write-good';
import textlintRuleTitleCase from 'textlint-rule-title-case';
import textlintRuleApostrophe from 'textlint-rule-apostrophe';
import terminology from './rules/terminology.js';

module.exports = {
const misspellings = textlintRuleCommonMisspellings.default;
const writegood = textlintRuleWriteGood.default;

export default {
rules: {
terminology,
'stop-words': stopwords,
'stop-words': textlintRuleStopWords,
'common-misspellings': misspellings,
'write-good': writegood,
'title-case': titlecase,
apostrophe,
'title-case': textlintRuleTitleCase,
apostrophe: textlintRuleApostrophe,
},

filters: {
Expand Down
9 changes: 5 additions & 4 deletions packages/textlint-rule-preset-alma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"author": "Tomáš Litera <tomas.litera@almacareer.com>",
"license": "MIT",
"type": "module",
Comment thread
literat marked this conversation as resolved.
"exports": {
".": "./index.js",
"./package.json": "./package.json"
Expand Down Expand Up @@ -40,11 +41,11 @@
"textlint-rule-write-good": "^2.0.0"
},
"devDependencies": {
"@textlint/kernel": "^12.2.2",
"@textlint/textlint-plugin-markdown": "^12.2.2",
"@textlint/textlint-plugin-text": "^12.2.2"
"@textlint/kernel": "^15.0.0",
"@textlint/textlint-plugin-markdown": "^15.0.0",
"@textlint/textlint-plugin-text": "^15.0.0"
},
"peerDependencies": {
"textlint": "^12.2.2"
"textlint": "^15.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/textlint-rule-preset-alma/rules/terminology.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const terminologyRule = require('textlint-rule-terminology');
import textlintRuleTerminology from 'textlint-rule-terminology';

const defaultOptions = {
defaultTerms: false,
Expand Down Expand Up @@ -96,7 +96,7 @@ function mergeOptions(options = {}) {
* @returns {object} textlint rule reporter
*/
function terminologyLinter(context, options) {
return terminologyRule.linter(context, mergeOptions(options));
return textlintRuleTerminology.linter(context, mergeOptions(options));
}

/**
Expand All @@ -106,10 +106,10 @@ function terminologyLinter(context, options) {
* @returns {object} textlint rule reporter
*/
function terminologyFixer(context, options) {
return terminologyRule.fixer(context, mergeOptions(options));
return textlintRuleTerminology.fixer(context, mergeOptions(options));
}

module.exports = {
export default {
linter: terminologyLinter,
fixer: terminologyFixer,
};
Loading