🚀 Socket Launch Week 🚀 Day 1: Introducing .NET Support in Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-woke

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-woke - npm Package Compare versions

Comparing version

to
1.0.0

5

lib/categories/gender.js

@@ -5,8 +5,9 @@ module.exports = [

words: [
'he', 'him', 'his', 'she', 'her', 'hers', 'man', 'woman',
'he', 'him', 'his', 'she', 'her', 'hers', 'man', 'woman', 'maid',
'girl', 'guy', 'gal', 'wench', 'dude', 'bro', 'boys', 'girls', 'guys', 'gals',
'businessman', 'businesswoman', 'chairman', 'chairwoman', 'mailman', 'mailwoman',
'postman', 'postwoman', 'policeman', 'policewoman', 'salesman', 'saleswoman', 'steward',
'stewardess', 'waiter', 'waitress', 'fireman', 'firewoman', 'barman', 'barwoman'
'stewardess', 'waiter', 'waitress', 'fireman', 'firewoman', 'barman', 'barwoman', 'barmaid'
]
}
];

26

lib/categories/LGBTQ.js

@@ -8,8 +8,8 @@ module.exports = [

words: [
"sissy', 'girlieman', 'pansy', 'janus', 'sodomite', 'nancy', 'poof', 'poofter",
"fairy', 'brownie', 'pillowbiter', 'bugger', 'cola', 'fudgepacker', 'nelly"
'sissy', 'girlieman', 'pansy', 'janus', 'sodomite', 'nancy', 'poof', 'poofter',
'fairy', 'brownie', ['pillow','biter'], 'bugger', 'cola', ['fudge','packer'], 'nelly'
]
}, {
description: '"{word}" is a slur against women',
words: ['faghag', 'fish', 'rugmuncher', 'marimacho', 'bitch']
words: [['fag','hag'], 'fish', ['rug','muncher'], 'marimacho', 'bitch']
}, {

@@ -21,7 +21,7 @@ description: '"{word}" is a slur against homosexuals',

words: [
"faggot', 'fag', 'fjolla', 'machobög', 'viado', 'shirtlifter', 'bardash', 'bakla",
"batiman","flamer","flaming","fruit","moffie","ponce","tapette","steamer",
"nola', 'flit', 'daffodil', 'jocker', 'quean', 'greek', 'tonk', 'lizzie",
"wonk', 'dorian', 'poove', 'sod', 'fairy', 'ogay', 'battyboy', 'battyman",
"nancy', 'nancyboy', 'woofter', 'twinkie', 'twink', 'swish', 'nelly', 'nellie"
'faggot', 'fag', 'fjolla', 'machobög', 'viado', ['shirt','lifter'], 'bardash', 'bakla',
'batiman','flamer','flaming','fruit','moffie','ponce','tapette','steamer',
'nola', 'flit', 'daffodil', 'jocker', 'quean', 'greek', 'tonk', 'lizzie',
'wonk', 'dorian', 'poove', 'sod', 'fairy', 'ogay', ['batty','boy'], ['batty','man'],
'nancy', ['nancy','boy'], 'woofter', 'twinkie', 'twink', 'swish', 'nelly', 'nellie'
]

@@ -33,3 +33,3 @@ }, {

description: '"{word}" is a slur against bisexual people',
words: ['acdc', 'switchhitter']
words: ['acdc', ['switch','hitter']]
}, {

@@ -40,9 +40,9 @@ description: '"{word}" is a slur against bisexual women',

description: '"{word}" is a slur against transgender people',
words: ['tranny', 'trannie', 'shim', 'heshe', 'transtrender', 'troon', 'it']
words: ['tranny', 'trannie', 'shim', 'heshe', 'transtrender', 'troon']
}, {
description: '"{word}" is a slur against trans men',
words: ['cuntboy', 'hefemale']
words: [['cunt','boy'], 'hefemale']
}, {
description: '"{word}" is a slur against trans women',
words: ['shemale', 'dickgirl', 'ladyboy', 'mahu', 'shim', 'trap', 'tim']
words: [['she','male'], ['dick','girl'], ['lady','boy'], 'mahu', 'shim', 'trap', 'tim']
}, {

@@ -68,4 +68,4 @@ description: '"{word}" is a slur against LGBTQ intersex people',

description: '"{word}" is a slur against androgynous men',
words: ['breckgirl']
words: [['breck','girl']]
}
];
module.exports = [
{
description: '"{word}" is profanity (English)',
words: ['fuck', 'shit', 'damn', 'ass', 'asshole', 'bastard', 'bitch', 'cunt', 'cock', 'twat']
words: [
'fuck', 'fucking', 'shit', 'shitty', 'shitting', 'damn', 'damnit',
'ass', 'asshole', 'asshat', 'bastard', 'bitch', 'cunt', 'cock', 'twat'
]
}
];
module.exports = [
{
description: '"{word}" could be seen as insensitive',
words: ['blacklist', 'whitelist', 'master', 'slave', 'blackball']
words: [
['black','list'], ['white','list'], 'master', 'slave',
['black','ball'], ['white','wash'], ['white','washed']
]
}, {
description: '"{word}" is an offensive term',
description: '"{word}" is an offensive term for an African person',
words: [
'af', 'ape', 'bluegum', 'boogie', 'buck', 'burrhead', 'colored', 'coon', 'crow',
'eggplant', 'fuzzies', 'golliwogg', 'jigaboo', 'jiggabo', 'jijjiboo', 'zigabo', 'jig',
'af', 'ape', ['blue','gum'], 'boogie', 'buck', ['burr','head'], 'colored', 'coon', 'crow',
['egg','plant'], 'fuzzies', 'golliwogg', 'jigaboo', 'jiggabo', 'jijjiboo', 'zigabo', 'jig',
'jigg', 'jiggy', 'jigga', 'kaffir', 'kaffer', 'kafir', 'kaffre', 'macaca', 'mammy', 'monkey',
'mosshead', 'munt', 'nigger', 'nigra', 'nigga', 'niggah', 'nigguh', 'niglet', 'nigglet', 'nigra',
'negra', 'niggra', 'nigrah', 'nigruh', 'pickaninny', 'quashie', 'sambo', 'sooty', 'spade',
'spook', 'teapot', 'thicklips', 'bootlips'
'spook', 'teapot', ['thick','lips'], ['boot','lips']
]

@@ -20,3 +23,6 @@ }, {

description: '"{word}" is an offensive term for an East Asian',
words: ['celestial', 'charlie', 'chinaman', 'chink', 'coolie', 'gook', 'jap', 'nip', 'oriental', 'yellow', 'yellowman']
words: [
'celestial', 'charlie', ['china','man'], 'chink', 'coolie', 'gook', 'jap',
'nip', 'oriental', 'yellow', 'yellowman'
]
}, {

@@ -30,3 +36,3 @@ description: '"{word}" is an offensive term for a South Asian',

description: '"{word}" is an offensive term for a Middle Easterner',
words: ['brownie', 'towelhead', 'raghead']
words: ['brownie', ['towel','head'], ['rag','head']]
}, {

@@ -36,4 +42,7 @@ description: '"{word}" is an offensive term for an Alaska native',

}, {
description: '"{word}" is an offensive term for a Latin American/Hispanic person',
words: ['spic', 'spick', 'spik', 'spig', 'brownie', 'wetback', 'greaseball', 'beaner', 'greaser', 'tacohead']
description: '"{word}" is an offensive term for a latin American/Hispanic person',
words: [
'spic', 'spick', 'spik', 'spig', 'brownie', ['wet','back'], ['grease','ball'],
'beaner', 'greaser', ['taco','head']
]
}, {

@@ -43,9 +52,9 @@ description: '"{word}" is an offensive term for a European',

'bule', 'charlie', 'cracker', 'farang', 'gammon', 'gringo', 'gubba', 'gweilo', 'gwailo',
'hunky', 'bohunk', 'medigan', 'ofay', 'arkie', 'okie', 'peckerwood'
'hunky', 'bohunk', 'medigan', 'ofay', 'arkie', 'okie', ['pecker','wood']
]
}, {
description: '"{word}" is an offensive term for a Mediterranean/Southern European',
words: ['chocko', 'dago', 'greaseball', 'greaser', 'kanake', 'métèque', 'wog']
words: ['chocko', 'dago', ['grease','ball'], 'greaser', 'kanake', 'métèque', 'wog']
}, {
description: '"{word}" is an offensive term for a Native American',
description: '"{word}" is an offensive term for a native American',
words: ['redskin', 'injun', 'brownie', 'chug', 'squaw']

@@ -60,3 +69,3 @@ }, {

description: '"{word}" is an offensive term for a white American',
words: ['cracker', 'redneck', 'hillbilly', 'trash', 'hick', 'bumpkin', 'peckerwood', 'whitey']
words: ['cracker', 'redneck', ['hill','billy'], 'trash', 'hick', 'bumpkin', ['pecker','wood'], 'whitey']
}, {

@@ -73,3 +82,3 @@ description: '"{word}" is an offensive term for Britons',

description: '"{word}" is an offensive term for a Italians',
words: ['dago', 'ginzo', 'goombah', 'greaseball', 'greaser', 'guido', 'guinea', 'polentone', 'terrone', 'wog', 'wop']
words: ['dago', 'ginzo', 'goombah', ['grease','ball'], 'greaser', 'guido', 'guinea', 'polentone', 'terrone', 'wog', 'wop']
}, {

@@ -95,3 +104,3 @@ description: '"{word}" is an offensive term for a Jew',

description: '"{word}" is an offensive term for Chinese people',
words: ['tiong', 'cheena', 'chinaman', 'ching', 'chang', 'chong', 'chink', 'chinky', 'chonky', 'coolie', 'slope', 'panface', 'lingling']
words: ['tiong', 'cheena', 'chinaman', 'ching', 'chang', 'chong', 'chink', 'chinky', 'chonky', 'coolie', 'slope', ['pan','face'], ['ling','ling']]
}, {

@@ -129,8 +138,1 @@ description: '"{word}" is an offensive term for Japanese people',

];
// copy(Array.from($0.getElementsByTagName('dt'))
// .map(e => e.innerText)
// .reduce((a, v) => a.concat(v.split(/[\/,]| and /g).map(vv => vv.trim().toLowerCase())),[])
// .filter(v => !v.includes(' '))
// .filter(v => !v.includes('-')))

@@ -22,5 +22,15 @@ /**

group.words.forEach(word => {
const descr = group.description.replace('{word}', word);
obj[word] = (obj[word] == null) ? '' : `${obj[word]}\n\r`;
obj[word] += descr;
const rootWord = Array.isArray(word) ? word[0] : word;
const words = Array.isArray(word) ? word : [word];
const descr = group.description.replace('{word}', words.join(' '));
obj[rootWord] = obj[rootWord] || [];
obj[rootWord].push({ descr, words });
// look for terms as a single word as well.
if (words.length > 1) {
const oneWord = words.join('');
const descr = group.description.replace('{word}', oneWord);
obj[oneWord] = obj[oneWord] || [];
obj[oneWord].push({ descr, words: [oneWord] });
}
})

@@ -75,11 +85,23 @@ return obj;

if (node.parent.type === 'MemberExpression') return;
const wordMatch = splitWords(node.name).find(word => wordMap.hasOwnProperty(word));
if (wordMatch == null) return;
context.report({node, message: wordMap[wordMatch]});
const message = splitWords(node.name).reduce((descr, root, idx, arr) => {
if (!wordMap.hasOwnProperty(root)) return descr;
const matchesDescr = wordMap[root]
.filter(m => m.words.join('') === arr.slice(idx, idx + m.words.length).join(''))
.map(m => m.descr).join('\n\r');
return [descr, matchesDescr].filter(v => v.length).join('\n\r');
}, '');
if (!message) return;
context.report({node, message});
},
Program() {
for (const node of sourceCode.getAllComments()) {
const wordMatch = splitWords(node.value).find(word => wordMap.hasOwnProperty(word));
if (wordMatch == null) return;
context.report({ node, message: wordMap[wordMatch] });
const message = splitWords(node.value).reduce((descr, root, idx, arr) => {
if (!wordMap.hasOwnProperty(root)) return descr;
const matchesDescr = wordMap[root]
.filter(m => m.words.join('') === arr.slice(idx, idx + m.words.length).join(''))
.map(m => m.descr).join('\n\r');
return [descr, matchesDescr].filter(v => v.length).join('\n\r');
}, '');
if (!message) return;
context.report({ node, message });
}

@@ -86,0 +108,0 @@ }

{
"name": "eslint-plugin-woke",
"version": "0.2.0",
"version": "1.0.0",
"description": "ESLint plugin to make your code more woke.",

@@ -30,5 +30,5 @@ "keywords": [

"engines": {
"node": ">=0.10.0"
"node": ">=10.0.0"
},
"license": "MIT"
}