Convert ESLint config to JavaScript

Writing the configuration in JavaScript is more approachable for
JavaScript developers than YAML and allows using the Node.js runtime if
careful relative path resolution is necessary for correct configuration.
diff --git a/.eslintignore b/.eslintignore
index 8b9639d..49e918e 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,4 @@
+!.eslintrc.js
 /coverage
 /packages/*/esm/*
 /packages/*/lib/*
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..2b8a0d7
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,76 @@
+module.exports = {
+  root: true,
+  env: {
+    es6: true,
+    'shared-node-browser': true,
+  },
+  extends: ['eslint:recommended', 'plugin:import/recommended', 'prettier'],
+  globals: {
+    globalThis: true,
+  },
+  parser: 'babel-eslint',
+  parserOptions: {
+    ecmaVersion: '2018',
+  },
+  plugins: ['import', 'prettier'],
+  rules: {
+    'import/no-default-export': 'error',
+    'import/order': 'error',
+    'import/unambiguous': 'error',
+    'no-restricted-syntax': [
+      'error',
+      'BindExpression',
+      'ClassProperty',
+      'Decorator',
+      'DoExpression',
+      'ExportDefaultSpecifier',
+      'ExportNamespaceSpecifier',
+      'TypeAnnotation',
+      'JSXElement',
+    ],
+    'prettier/prettier': [
+      'error',
+      {
+        singleQuote: true,
+        trailingComma: 'es5',
+      },
+    ],
+  },
+  settings: {
+    'import/resolver': {
+      'babel-module': {},
+    },
+  },
+  overrides: [
+    {
+      files: ['.eslintrc.js', '.mocharc.js', 'babel.config.js', 'scripts/*.js'],
+      env: {
+        node: true,
+      },
+      parser: 'espree',
+      parserOptions: {
+        sourceType: 'script',
+      },
+      plugins: ['node'],
+      rules: {
+        'no-console': 'off',
+        'node/no-unsupported-features': 'error',
+      },
+    },
+    {
+      files: ['demo/**/*.js'],
+      env: {
+        browser: true,
+      },
+    },
+    {
+      files: ['packages/*/test/**/*.js', 'test/**/*.js'],
+      env: {
+        mocha: true,
+      },
+      globals: {
+        assert: true,
+      },
+    },
+  ],
+};
diff --git a/.eslintrc.yml b/.eslintrc.yml
deleted file mode 100644
index 795d782..0000000
--- a/.eslintrc.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-root: true
-
-env:
-  es6: true
-  shared-node-browser: true
-
-extends:
-  - eslint:recommended
-  - plugin:import/recommended
-  - prettier
-
-globals:
-  globalThis: true
-
-parser: babel-eslint
-
-parserOptions:
-  ecmaVersion: 2018
-
-plugins:
-  - import
-  - prettier
-
-rules:
-  import/no-default-export: error
-  import/order: error
-  import/unambiguous: error
-  no-restricted-syntax:
-    - error
-    - BindExpression
-    - ClassProperty
-    - Decorator
-    - DoExpression
-    - ExportDefaultSpecifier
-    - ExportNamespaceSpecifier
-    - TypeAnnotation
-    - JSXElement
-  prettier/prettier:
-    - error
-    - singleQuote: true
-      trailingComma: es5
-
-settings:
-  import/resolver: babel-module
-
-overrides:
-  - files:
-      - '.mocharc.js'
-      - 'babel.config.js'
-      - 'scripts/*.js'
-    env:
-      node: true
-    parser: espree
-    parserOptions:
-      sourceType: script
-    plugins:
-      - node
-    rules:
-      no-console: off
-      node/no-unsupported-features: error
-  - files:
-      - 'demo/**/*.js'
-    env:
-      browser: true
-  - files:
-      - 'packages/*/test/**/*.js'
-      - 'test/**/*.js'
-    env:
-      mocha: true
-    globals:
-      assert: true