# @stackline/alex > Inclusive-language checks for prose and Markdown, preserving the alex 11 API and CLI. [](https://www.npmjs.com/package/@stackline/alex) [](https://github.com/alexandroit/stackline-alex) [](https://github.com/alexandroit/stackline-alex) [](https://alexandro.net/docs/vanilla/alex/) [](https://www.reddit.com/r/Stackline/) **[Documentation](https://alexandro.net/docs/vanilla/alex/)** | **[npm](https://www.npmjs.com/package/@stackline/alex)** | **[Issues](https://github.com/alexandroit/stackline-alex/issues)** | **[Repository](https://github.com/alexandroit/stackline-alex)** **Current package version:** `1.0.4` --- ## Why this package? An independent MIT-licensed compatibility fork of `alex@11.0.1`. The language checks, word lists, API exports, and default CLI behavior are preserved. ```sh npm install --save-dev @stackline/alex ``` The executable is still named `alex`. Version 1.0.0 adds an opt-in flag for tools that pass explicit filenames, including pre-commit: ```sh alex changed.md ignored.csv --silently-ignore ``` Files matched by `.alexignore` are skipped with this flag. Without it, naming an ignored file explicitly still reports an error. Other files are checked normally, and missing files remain errors. Default directory discovery continues to honor ignore rules automatically. This addresses the request in [upstream issue #348](https://github.com/get-alex/alex/issues/348). Node.js 20.19 or newer is supported. The CLI directly uses the compatible `@stackline/unified-engine` and `@stackline/unified-diff` forks. `supports-color` is now an explicit dependency. The public type declarations are retained from the original published package and tested with a TypeScript consumer. The `--diff` option also retains warnings on replacement lines correctly when running on Travis or GitHub Actions. Previously, deleted lines in the same diff could shift the target line numbers and suppress a warning on a changed line. For development, run `npm ci`, `npm run build`, `npm run lint`, `npm test`, and `npm run test:types`. These checks do not format or rewrite source files. The upstream API/CLI tests remain, with additional executable-level regressions for ignored files. Tape's development-only glob dependency is updated through an override; it is not part of the installed runtime package. The source basis is the upstream `11.0.1` tag and the `alex@11.0.1` npm artifact, published on 2023-08-18. The artifact integrity is `sha512-rKLBZxD/lvuykdC6XB8ma9YjDl46j9ayHROZUtC1yJ2jlGpoP7RZR1tBBSjtlr260ixIW6iCkqAnHzmti5Q6CQ==`. The original license and contributor attribution are retained. This fork uses its own 1.x version series and does not imply upstream endorsement. The original guide follows. Install and import `@stackline/alex` when using this fork; the commands and API behavior remain compatible. ---
He walked to class.
').messages ``` Yields: ```js [ [1:18-1:20: `He` may be insensitive, use `They`, `It` instead] { message: '`He` may be insensitive, use `They`, `It` instead', name: '1:18-1:20', reason: '`He` may be insensitive, use `They`, `It` instead', line: 1, column: 18, location: { start: [Object], end: [Object] }, source: 'retext-equality', ruleId: 'he-she', fatal: false, actual: 'He', expected: [ 'They', 'It' ] } ] ``` ### `text(value, config)` Check plain text (as in, syntax is checked). ###### Parameters * `value` ([`VFile`][vfile] or `string`) — Text document * `config` (`Object`, optional) — See the [Configuration][] section ###### Returns [`VFile`][vfile]. ###### Example ```js import {markdown, text} from '@stackline/alex' markdown('The `boogeyman`.').messages // => [] text('The `boogeyman`.').messages ``` Yields: ```js [ [1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster` instead] { message: '`boogeyman` may be insensitive, use `boogeymonster` instead', name: '1:6-1:15', reason: '`boogeyman` may be insensitive, use `boogeymonster` instead', line: 1, column: 6, location: Position { start: [Object], end: [Object] }, source: 'retext-equality', ruleId: 'boogeyman-boogeywoman', fatal: false, actual: 'boogeyman', expected: [ 'boogeymonster' ] } ] ``` ### Workflow The recommended workflow is to add **alex** to `package.json` and to run it with your tests in Travis. You can opt to ignore warnings through [alexrc][configuration] files and [control comments][control]. A `package.json` file with [npm scripts][npm-scripts], and additionally using [AVA][] for unit tests, could look like so: ```json { "scripts": { "test-api": "ava", "test-doc": "alex", "test": "npm run test-api && npm run test-doc" }, "devDependencies": { "alex": "^1.0.0", "ava": "^0.1.0" } } ``` If you’re using Travis for continuous integration, set up something like the following in your `.travis.yml`: ```diff script: - npm test +- alex --diff ``` Make sure to still install alex though! If the `--diff` flag is used, and Travis is detected, lines that are not changes in this push are ignored. Using this workflow, you can merge PRs if it has warnings, and then if someone edits an entirely different file, they won’t be bothered about existing warnings, only about the things they added! ### FAQ ### This is stupid! Not a question. And yeah, alex isn’t very smart. People are much better at this. But people make mistakes, and alex is there to help. ### alex didn’t check “X”! See [`contributing.md`][contributing] on how to get “X” checked by alex. ### Why is this named alex? It’s a nice unisex name, it was free on npm, I like it! :smile: ### Further reading No automated tool can replace studying inclusive communication and listening to the lived experiences of others. An error from `alex` can be an invitation to learn more. These resources are a launch point for deepening your own understanding and editorial skills beyond what `alex` can offer: * The [18F Content Guide](https://content-guide.18f.gov/our-style/inclusive-language/) has a helpful list of links to other inclusive language guides used in journalism and academic writing. * The [Conscious Style Guide](https://consciousstyleguide.com/articles/) has articles on many nuanced topics of language. For example, the terms race and ethnicity mean different things, and choosing the right word is up to you. Likewise, a sentence that overgeneralizes about a group of people (e.g. “Developers love to code all day”) may not be noticed by `alex`, but it is not inclusive. A good human editor can step up to the challenge and find a better way to phrase things. * Sometimes, the only way to know what is inclusive is to ask. In [Disability is a nuanced thing](https://incl.ca/disability-language-is-a-nuanced-thing/), Nicolas Steenhout writes about how person-first language, such as “a person with a disability,” is not always the right choice. * Language is always evolving. A term that is neutral one year ago can be problematic today. Projects like the [Self-Defined Dictionary](https://github.com/selfdefined/web-app) aim to collect the words that we use to define ourselves and others, and connect them with the history and some helpful advice. * Unconsious bias is present in daily decisions and conversations and can show up in writing. [Textio](https://textio.com/blog/4-overlooked-types-of-bias-in-business-writing/27521593662) offers some examples of how descriptive adjective choice and tone can push some people away, and how regional language differences can cause confusion. * Using complex sentences and uncommon vocabulary can lead to less inclusive content. This is described as literacy exclusion in [this article by Harver](https://harver.com/blog/inclusive-job-descriptions/). This is critical to be aware of if your content has a global audience, where a reader’s strongest language may not be the language you are writing in. ## Local Development Clone the [repository](https://github.com/alexandroit/stackline-alex) and run the following commands from its root: ```bash npm ci npm run build npm test npm run lint npm run test:types ``` The retained upstream development notes below include historical tooling; the commands above are the maintained package checks. ### Contribute See [`contributing.md`][contributing] in [`get-alex/.github`][health] for ways to get started. See [`support.md`][support] for ways to get help. This project has a [Code of conduct][coc]. By interacting with this repository, organization, or community you agree to abide by its terms. ## Release Checklist 1. Update the package version, lockfile, generated version fields, and changelog together. 2. Run the development checks above and audit both `npm audit` and `npm audit --omit=dev`. 3. Use the [GitHub publish workflow](https://github.com/alexandroit/stackline-alex/actions/workflows/publish.yml) with its `Prod` environment to publish the exact CI tarball. 4. Verify public npm bytes, package identity, provenance, and the immutable GitHub release evidence. ## License [MIT](https://github.com/alexandroit/stackline-alex/blob/main/license). Original copyright notices and upstream attribution are retained. ### Acknowledgments Preliminary work for alex was done [in 2015][preliminary]. The project was authored by [**@wooorm**][wooorm]. Lots of [people helped since][contributors]! [MIT][license] © [Titus Wormer][author] [build]: https://github.com/get-alex/alex/actions [build-badge]: https://github.com/get-alex/alex/workflows/main/badge.svg [coverage]: https://codecov.io/github/get-alex/alex [coverage-badge]: https://img.shields.io/codecov/c/github/get-alex/alex.svg [first-timers]: https://www.firsttimersonly.com/ [first-timers-badge]: https://img.shields.io/badge/first--timers--only-friendly-blue.svg [node]: https://nodejs.org/en/download/ [npm]: https://docs.npmjs.com/cli/install [yarn]: https://yarnpkg.com/ [setup-tutorial]: https://dev.to/meeshkan/setting-up-the-alex-js-language-linter-in-your-project-3bpl [demo]: http://alexjs.com/#demo [screenshot]: https://raw.githubusercontent.com/alexandroit/stackline-alex/main/screenshot.png [vfile]: https://github.com/vfile/vfile [profanities]: https://github.com/retextjs/retext-profanities/blob/main/rules.md [equality]: https://github.com/retextjs/retext-equality/blob/main/rules.md [vfile-message]: https://github.com/vfile/vfile#vfilemessages [literals]: https://github.com/syntax-tree/nlcst-is-literal#isliteralparent-index [eslintignore]: http://eslint.org/docs/user-guide/configuring.html#ignoring-files-and-directories [cuss]: https://github.com/words/cuss [npm-scripts]: https://docs.npmjs.com/misc/scripts [ava]: http://ava.li [author]: http://wooorm.com [health]: https://github.com/get-alex/.github [contributing]: https://github.com/get-alex/.github/blob/main/contributing.md [support]: https://github.com/get-alex/.github/blob/main/support.md [coc]: https://github.com/get-alex/.github/blob/main/code-of-conduct.md [tweet]: https://twitter.com/kwuchu/status/618799087006130176 [twitter]: https://twitter.com/wooorm/status/639123753490907136 [producthunt]: https://www.producthunt.com/posts/alex [tnw]: http://thenextweb.com/apps/2015/09/11/alex-stops-you-from-publishing-inconsiderate-content/ [vice]: https://www.vice.com/en_us/article/nzeawx/meet-alex-the-javascript-tool-to-make-your-code-less-offensive [bustle]: https://www.bustle.com/articles/108684-alex-javascript-tool-corrects-harmful-language-in-your-writing-because-there-are-some-mistakes-spell-check [dailydot]: https://www.dailydot.com/debug/alex-coding-tool-offensive/ [iheany]: https://github.com/iheanyi [sindre]: https://github.com/sindresorhus [wooorm]: https://github.com/wooorm [preliminary]: https://github.com/get-alex/alex/commit/3621b0a [contributors]: https://github.com/get-alex/alex/graphs/contributors [.alexignore]: https://github.com/alexandroit/stackline-alex/blob/main/.alexignore [license]: license [control]: #control [configuration]: #configuration [ignoring-files]: #ignoring-files [alexignore]: #alexignore [mdx]: https://mdxjs.com [mdx-next]: https://github.com/mdx-js/mdx/issues/1041 ## Credits and original authors - Original project: [alex](https://github.com/get-alex/alex). - Titus Wormer. - Sindre Sorhus. - Shinnosuke Watanabe. - Carolyn Stransky. - Riley Martine. - F. - Jen Weber. - John-David Dalton. - Lee Mulvey. - Mary McGrath. - Nick Radford. - Ricky. - Sachin Malhotra. - Simon Knott. - Taylor Reece. - Tim. - Vaishnavi Janardhan. - Conor Hastings. - Abhinav Gautam. - Alex Gleason. - Ansel Halliburton. - Ben Junya. - Christian Oliff. - Daan. - Copyright (c) 2015 Titus Wormer