0.1.2 • Published 8 years ago

halint v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

🐸 HaLint

Build Status

HaLint, aka wright, is a simple language linter mainly for Chinese. And it can also check your source file format(Markdown, etc.).

Usage

npm i halint --save
import halint from 'halint';
const fileContent = '你们有一个好,全世界甚么地方,你们跑得最快,但是问来问去的问题呀,too simple,sometimes naive,懂得没有?';
const rules = { syntax: {}, lang: {
  'space-between-han-west': true,
  'avoid-curly-quotes': true,
  'avoid-conjuncted-spaces': true,
  'prefer-full-punctuations': true,
} };

halint(fileContent, 'zh_cn', 'plain', rules);

Full documentation coming soon.

Upgrading from wright

Remove your wright-core install and install halint instead.

If you use the halint.b.min.js, there should be no change except use halint instead of wright.

If you import from this package, you won't need to change anything. But we suggest using the new name in your code. If so, please don't forget to change wright into halint as stated in Usage above. You'll need to replace all wright() calls to halint(), too.

Contributing

Build locally

Node (Normal Environment)

npm run build, and you'll see the Babel-compiled files in dist/.

Browser

npm run build && npm run build-browser, dist/halint.b.js is the browser bundle.

To minify, use npm run browser-minify then.

You'll need to load babel-polyfill and underscore before the browser bundle, as we just have a shim to load them from window. So lodash may also works with wright as we just use window._.

Running tests

Build first, and then npm test.

Code linting

npm run lint powered by ESLint. Please ensure that your code is linting-error/warnings-free before submitting a PR.

License

MIT

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago