eslint-config-cityssm
Version:
ESLint rules used in the City of Sault Ste. Marie's TypeScript projects.
30 lines (29 loc) • 1.03 kB
JavaScript
import list1 from 'eslint-plugin-woke/lib/categories/gender.js';
import list2 from 'eslint-plugin-woke/lib/categories/LGBTQ.js';
import list3 from 'eslint-plugin-woke/lib/categories/profanity.js';
import list4 from 'eslint-plugin-woke/lib/categories/racism.js';
import { words } from './cspell.words.js';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-type-assertion
const unformattedWordLists = [...list1, ...list2, ...list3, ...list4];
const wordListSet = new Set();
for (const unformattedWordList of unformattedWordLists) {
for (const word of unformattedWordList.words) {
if (typeof word === 'string') {
wordListSet.add(word);
}
else {
wordListSet.add(word.join(''));
}
}
}
/**
* Remove all allowed words
*/
for (const wordToRemove of words) {
wordListSet.delete(wordToRemove);
}
/**
* Words that will be flagged as not allowed.
*/
export const flagWords = [...wordListSet];
export default flagWords;