You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ra...@apache.org on 2019/05/23 15:29:46 UTC
[incubator-annotator] branch master updated (8a6f998 -> 3297bca)
This is an automated email from the ASF dual-hosted git repository.
randall pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git.
from 8a6f998 Add dependency from dom on text
new 0120721 Fix text package main and module fields
new 0ffc4bc Restrict Babel resolver alias to bare specifiers
new 828a182 Convert ESLint config to JavaScript
new 3f0b35d Copy Babel resolver alias config to ESLint config
new 3297bca Remove .mjs extension from ESLint invocation
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.eslintignore | 1 +
.eslintrc.js | 80 ++++++++++++++++++++++++++++++++++++++++++++++
.eslintrc.yml | 71 ----------------------------------------
babel.config.js | 2 +-
package.json | 2 +-
packages/text/package.json | 3 +-
6 files changed, 85 insertions(+), 74 deletions(-)
create mode 100644 .eslintrc.js
delete mode 100644 .eslintrc.yml
[incubator-annotator] 03/05: Convert ESLint config to JavaScript
Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 828a182d3fb6d068331e99c27ba0f4cf13508678
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Thu May 23 10:42:53 2019 -0400
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.
---
.eslintignore | 1 +
.eslintrc.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.eslintrc.yml | 71 -------------------------------------------------------
3 files changed, 77 insertions(+), 71 deletions(-)
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
[incubator-annotator] 04/05: Copy Babel resolver alias config to
ESLint config
Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 3f0b35d8b12a12214f5b2ba4c93e872d68317f19
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Thu May 23 11:26:03 2019 -0400
Copy Babel resolver alias config to ESLint config
At the time of writing, eslint-import-resolver-babel-module does not
find the monorepo Babel configuration so the alias configuration must be
repeated in the ESLint configuration file.
---
.eslintrc.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 2b8a0d7..a82fcb9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -38,7 +38,11 @@ module.exports = {
},
settings: {
'import/resolver': {
- 'babel-module': {},
+ 'babel-module': {
+ alias: {
+ '^@annotator/(.+)$': '@annotator/\\1/src/index.js',
+ },
+ },
},
},
overrides: [
[incubator-annotator] 05/05: Remove .mjs extension from ESLint
invocation
Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 3297bcaf41892bba7aa0a626e7b5a1865bd35d43
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Thu May 23 11:29:13 2019 -0400
Remove .mjs extension from ESLint invocation
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9b2468d..0d64e5b 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
"build:esm": "cross-env BABEL_ENV=esm yarn build:babel -d esm src",
"build:misc": "lerna exec -- cp ../../LICENSE ../../NOTICE .",
"clean": "lerna exec -- rimraf LICENSE NOTICE esm lib",
- "lint": "eslint . --ext js,mjs --fix --quiet",
+ "lint": "eslint --fix --quiet .",
"prepare": "lerna run prepare",
"prepublish": "yarn run build",
"start": "webpack-dev-server --hot --mode development",
[incubator-annotator] 01/05: Fix text package main and module fields
Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 012072144de41f681353b814b6baa790bafcd9d6
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Wed May 22 15:59:49 2019 -0400
Fix text package main and module fields
---
packages/text/package.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/text/package.json b/packages/text/package.json
index dbee114..b9d93da 100644
--- a/packages/text/package.json
+++ b/packages/text/package.json
@@ -9,7 +9,8 @@
},
"license": "Apache-2.0",
"author": "Apache Software Foundation",
- "main": "lib",
+ "main": "lib/index.js",
+ "module": "esm/index.js",
"dependencies": {
"@babel/runtime-corejs3": "^7.4.0",
"core-js": "3"
[incubator-annotator] 02/05: Restrict Babel resolver alias to bare
specifiers
Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 0ffc4bcdd4794eee21d4e2c05da7f3504aa22aac
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Thu May 23 11:24:19 2019 -0400
Restrict Babel resolver alias to bare specifiers
Rather than aliasing resolving subpaths of packages of the annotator
scope, only alias bare specifiers. There should never be a deep import
because all public APIs should be exported through the top-level
namespace module of a package.
---
babel.config.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/babel.config.js b/babel.config.js
index aed0a9e..0bff4ff 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -33,7 +33,7 @@ module.exports = api => {
// Used for resolving source files during development and testing.
let resolverOptions = {
alias: {
- '^(@annotator/.+?)(/|$)': '\\1/src',
+ '^@annotator/(.+)$': '@annotator/\\1/src/index.js',
},
};