ESLint configurations for modern projects using JavaScript.
Look at the example config file for basic usage.
Note: uses ESLint 9 and modern JavaScript.
Requires ESlint version 9 and above:
npm install --save-dev eslint@^9Install the normal way:
npm install --save-dev eslint @tobiaslabs/eslint-config-javascriptCreate an ESLint config file:
touch eslint.config.jsImport the default and use the config property as your overall configuration and style enforcement:
import javascript from '@tobiaslabs/eslint-config-javascript'
export default [
...javascript.config,
]Specify globals for specific runtimes using the environment property and one of the following:
browser- Modern browser runtime.mongosh- MongoDB shell runtime.nodejs- Modern Node.js runtime.serviceworker- Modern browser ServiceWorker runtime.
To use them, use the rest-spread inside an object, and specify the filepaths that execute in that environment.
For example, for JavaScript that is in a folder path src and executes in the browser:
import javascript from '@tobiaslabs/eslint-config-javascript'
export default [
// ... other configurations, then ...
{
...javascript.environment.browser,
files: [
'src/**/*.js',
],
},
]Published and released under the Very Open License.