-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to ESM, Refactor Tests to Node's Test Runner (#117)
* Update dependencies * Update eslint config * ESM port * Fix for running on Apple based Macs * Add missing ignore rules * Improve export visibility * Adjust documentation for ESM * Refactor tests to use Node's builtin test runner * Run tests with coverage * Remove unused code * Fix setting max iterations not applied * Use API for setting log level * Add tests for createNewNode
- Loading branch information
1 parent
21e0078
commit 5e456e2
Showing
105 changed files
with
3,261 additions
and
2,911 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import globals from 'globals'; | ||
import path from 'node:path'; | ||
import {fileURLToPath} from 'node:url'; | ||
import js from '@eslint/js'; | ||
import {FlatCompat} from '@eslint/eslintrc'; | ||
import babelParser from "@babel/eslint-parser"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
'tests/resources', | ||
'**/jquery*.js', | ||
'**/*tmp*.*', | ||
'**/*tmp*/', | ||
"eslint.config.js", | ||
"node_modules/", | ||
], | ||
}, | ||
...compat.extends('eslint:recommended'), | ||
{ | ||
languageOptions: { | ||
parser: babelParser, | ||
parserOptions: { | ||
requireConfigFile: false, | ||
babelOptions: { | ||
plugins: ['@babel/plugin-syntax-import-assertions'], | ||
} | ||
}, | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.commonjs, | ||
}, | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
indent: ['error', 'tab', { | ||
SwitchCase: 1, | ||
}], | ||
'linebreak-style': ['error', 'unix'], | ||
quotes: ['error', 'single', { | ||
allowTemplateLiterals: true, | ||
}], | ||
semi: ['error', 'always'], | ||
'no-empty': ['off'], | ||
}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
module.exports = { | ||
REstringer: require(__dirname + '/src/restringer'), | ||
deobModules: require(__dirname + '/src/modules'), | ||
processors: require(__dirname + '/src/processors'), | ||
}; | ||
export * from './src/restringer.js'; | ||
export * from './src/modules/index.js'; | ||
export * from './src/processors/index.js'; |
Oops, something went wrong.