Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.
Open
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
9 changes: 0 additions & 9 deletions .eslintrc.json

This file was deleted.

34 changes: 34 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const js = require('@eslint/js');

module.exports = [
{
ignores: ['node_modules/**'],
},
js.configs.recommended,
{
files: ['tests/**/*.js'],
languageOptions: {
globals: {
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
vi: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
},
},
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
},
rules: {
indent: ['error', 4, { SwitchCase: 1 }],
curly: 'error',
eqeqeq: ['error', 'always'],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
];
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function( source ) {

for ( let key in dict ) {

if ( !dict.hasOwnProperty( key ) ) {
if ( !Object.hasOwn( dict, key ) ) {
continue;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/filters/bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BemFilter extends BaseFilter {
.join(' ');
}

_setOrAddAttr( text, tag, attrName, attrDef, condFn ) { // eslint-disable-line max-params
_setOrAddAttr( text, tag, attrName, attrDef, condFn ) {
const tagRe = new RegExp( `<(${tag})\\b([^/>]*)`, 'g' );

return text.replace( tagRe, ( match, tag, attrs ) => {
Expand Down Expand Up @@ -63,7 +63,7 @@ class BemFilter extends BaseFilter {

for ( let tag in classes ) {

if ( !classes.hasOwnProperty( tag ) ) {
if ( !Object.hasOwn( classes, tag ) ) {
continue;
}

Expand All @@ -77,11 +77,11 @@ class BemFilter extends BaseFilter {

for ( let tag in attrs ) {

if ( !attrs.hasOwnProperty( tag ) ) {
if ( !Object.hasOwn( attrs, tag ) ) {
continue;
}

Object.keys( attrs[tag] ).forEach( attrName => { // eslint-disable-line no-loop-func
Object.keys( attrs[tag] ).forEach( attrName => {
res = this._setOrAddAttr( res, tag, attrName, attrs[tag][attrName] );
} );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/filters/plugins/babelfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function( md ) {
return token.type === 'paragraph_open';
} ).length;

if ( pLength == 1 && ( type === 'paragraph_open' || type === 'paragraph_close' ) ) {
if ( pLength === 1 && ( type === 'paragraph_open' || type === 'paragraph_close' ) ) {
return '';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/flatten.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function process( obj, prefix, storage ) {

for ( let key in obj ) {

if ( !obj.hasOwnProperty( key ) ) {
if ( !Object.hasOwn( obj, key ) ) {
continue;
}

Expand Down
Loading