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/10/27 23:03:04 UTC
[incubator-annotator] branch master updated (36936e1 -> 54daa78)
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 36936e1 Remove email requirement from CoC
new c542745 Specify babel module resolver options once
new 54daa78 Be strict with import/no-internal-modules in tests
The 2 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:
.eslintrc.js | 22 ++++++++++++++++------
babel.config.js | 4 ++--
2 files changed, 18 insertions(+), 8 deletions(-)
[incubator-annotator] 02/02: Be strict with
import/no-internal-modules in tests
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 54daa7864ba29bd5a328e6ed7e1c22ebcf615361
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Sun Oct 13 20:33:40 2019 -0400
Be strict with import/no-internal-modules in tests
---
.eslintrc.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 526cfc3..c52aaad 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,3 +1,5 @@
+const path = require('path');
+
const babel = require('@babel/core');
// Use the root babel.config.js for module resolution.
@@ -90,7 +92,10 @@ module.exports = {
'import/no-internal-modules': [
'error',
{
- allow: ['ajv/lib/refs/json-schema-draft-04.json', 'src/**'],
+ allow: [
+ 'ajv/lib/refs/json-schema-draft-04.json',
+ path.resolve(__dirname, './packages/*/src/**'),
+ ],
},
],
'import/no-relative-parent-imports': 'off',
[incubator-annotator] 01/02: Specify babel module resolver options
once
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 c5427459dde442ebfb585cb19afa8344717a63b9
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Sun Oct 13 20:31:45 2019 -0400
Specify babel module resolver options once
---
.eslintrc.js | 15 ++++++++++-----
babel.config.js | 4 ++--
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index cb6c43c..526cfc3 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,3 +1,12 @@
+const babel = require('@babel/core');
+
+// Use the root babel.config.js for module resolution.
+// Relevant issue: tleunen/eslint-import-resolver-babel-module#89
+const babelOptions = babel.loadOptions({ cwd: __dirname });
+const babelModuleResolver = babelOptions.plugins.find(
+ ({ key }) => key === 'module-resolver',
+);
+
module.exports = {
root: true,
env: {
@@ -44,11 +53,7 @@ module.exports = {
},
settings: {
'import/resolver': {
- 'babel-module': {
- alias: {
- '^@annotator/(.+)$': '@annotator/\\1/src/index.js',
- },
- },
+ 'babel-module': babelModuleResolver.options,
},
},
overrides: [
diff --git a/babel.config.js b/babel.config.js
index 6469948..ffb36ab 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -35,7 +35,7 @@ module.exports = api => {
};
// Options for the module-resolver plugin.
- // Used for resolving source files during development and testing.
+ // Used for resolving source files during development.
let resolverOptions = {
alias: {
'^@annotator/(.+)$': '@annotator/\\1/src/index.js',
@@ -54,7 +54,7 @@ module.exports = api => {
plugins: [
'preserve-comment-header',
['@babel/transform-runtime', runtimeOptions],
- ...(DEV || TEST ? [['module-resolver', resolverOptions]] : []),
+ ...(DEV ? [['module-resolver', resolverOptions]] : []),
...(TEST ? ['istanbul'] : []),
],
presets: [['@babel/env', envOptions]],