Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

chore: fix end-of-file #1468

Merged
merged 9 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ esm/
lib/
tmp/
dist/
temporary-plugins/
temporary-plugins/
40 changes: 39 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
// Allow core/src and core/test, not import modules from lib
'import/internal-regex': /^@superset-ui\/core\/(src|test)/,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be 'import/internal-regex': /^@superset-ui\/([\w-]+)\/(src|test)/, to match all packages/plugins?

Copy link
Contributor Author

@zhaoyongjie zhaoyongjie Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid import packages like this:
@superset-ui/chart-controls/(src|test)/....
instead of
@superset-ui/chart-controls

'import/core-modules': [
'@superset-ui/core',
'@superset-ui/chart-controls',
'@superset-ui/legacy-plugin-chart-calendar',
'@superset-ui/legacy-plugin-chart-chord',
'@superset-ui/legacy-plugin-chart-country-map',
'@superset-ui/legacy-plugin-chart-event-flow',
'@superset-ui/legacy-plugin-chart-force-directed',
'@superset-ui/legacy-plugin-chart-heatmap',
'@superset-ui/legacy-plugin-chart-histogram',
'@superset-ui/legacy-plugin-chart-horizon',
'@superset-ui/legacy-plugin-chart-map-box',
'@superset-ui/legacy-plugin-chart-paired-t-test',
'@superset-ui/legacy-plugin-chart-parallel-coordinates',
'@superset-ui/legacy-plugin-chart-partition',
'@superset-ui/legacy-plugin-chart-pivot-table',
'@superset-ui/legacy-plugin-chart-rose',
'@superset-ui/legacy-plugin-chart-sankey',
'@superset-ui/legacy-plugin-chart-sankey-loop',
'@superset-ui/legacy-plugin-chart-sunburst',
'@superset-ui/legacy-plugin-chart-time-table',
'@superset-ui/legacy-plugin-chart-treemap',
'@superset-ui/legacy-plugin-chart-world-map',
'@superset-ui/legacy-preset-chart-big-number',
'@superset-ui/legacy-preset-chart-nvd3',
'@superset-ui/plugin-chart-echarts',
'@superset-ui/plugin-chart-table',
'@superset-ui/plugin-chart-word-cloud',
'@superset-ui/preset-chart-xy',
],
react: {
version: 'detect',
},
Expand Down Expand Up @@ -215,7 +247,13 @@ module.exports = {
},
},
{
files: ['*.test.*', './**/test/**/*'],
files: [
'*.test.ts',
'*.test.tsx',
'*.test.js',
'*.test.jsx',
'fixtures.*',
],
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
env: {
'jest/globals': true,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:

- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run ESLint
run: npm run lint --quiet
- name: Build packages
run: npm run build
- name: Run unit tests
run: npm run test
- name: Build Storybook
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx .",
"format": "npm run prettier",
"prettier": "prettier --write .",
"prettier": "prettier --write './{plugins,packages}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}'",
"test": "npm run jest",
"test:watch": "npm run lint:fix && npm run jest --watch",
"type": "npm run build --no-babel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
│   └── index.test.ts
└── types
└── external.d.ts
```
```
2 changes: 1 addition & 1 deletion packages/generator-superset/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion packages/superset-ui-chart-controls/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export type TabOverride = 'data' | 'customize' | boolean;
* show a warning based on the value of another component. It's also possible to bind
* arbitrary data from the redux store to the component this way.
* - tabOverride: set to 'data' if you want to force a renderTrigger to show up on the `Data`
tab, or 'customize' if you want it to show up on that tam. Otherwise sections with ALL
tab, or 'customize' if you want it to show up on that tam. Otherwise sections with ALL
`renderTrigger: true` components will show up on the `Customize` tab.
* - visibility: a function that uses control panel props to check whether a control should
* be visibile.
Expand Down
2 changes: 1 addition & 1 deletion packages/superset-ui-chart-controls/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
8 changes: 6 additions & 2 deletions packages/superset-ui-chart-controls/test/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
* under the License.
*/
import { AdhocColumn } from '@superset-ui/core';
import { isAdhocColumn, isColumnMeta, isSavedExpression } from '../src';
import { ColumnMeta } from '../lib';
import {
isAdhocColumn,
isColumnMeta,
isSavedExpression,
ColumnMeta,
} from '../src';

const ADHOC_COLUMN: AdhocColumn = {
hasCustomLabel: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/superset-ui-chart-controls/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"path": "../superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion packages/superset-ui-core/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion packages/superset-ui-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"../../types/**/*"
],
"references": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-calendar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-chord/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-country-map/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-event-flow/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-force-directed/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-heatmap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-histogram/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-horizon/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-map-box/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-map-box/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-paired-t-test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"declarationDir": "lib",
"outDir": "lib",
"rootDir": "src"
"rootDir": "src",
"allowJs": false
},
"exclude": [
"lib",
Expand All @@ -22,4 +23,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-partition/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-partition/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-pivot-table/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-rose/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-sankey-loop/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-sankey/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-sunburst/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-time-table/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-treemap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-world-map/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-preset-chart-big-number/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-preset-chart-nvd3/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"path": ".."
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/legacy-preset-chart-nvd3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
2 changes: 2 additions & 0 deletions plugins/plugin-chart-echarts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export { default as TimeseriesTransformProps } from './Timeseries/transformProps
export { default as TreeTransformProps } from './Tree/transformProps';
export { default as TreemapTransformProps } from './Treemap/transformProps';

export { DEFAULT_FORM_DATA as TimeseriesDefaultFormData } from './Timeseries/types';

export * from './types';

/**
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugin-chart-echarts/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"path": "../../../packages/superset-ui-core"
}
]
}
}
2 changes: 1 addition & 1 deletion plugins/plugin-chart-echarts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"path": "../../packages/superset-ui-core"
}
]
}
}
Binary file modified plugins/plugin-chart-pivot-table/src/images/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/plugin-chart-table/test/TableChart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/
import React from 'react';
import { CommonWrapper } from 'enzyme';
import { mount } from '../../../test/enzyme';
import TableChart from '../src/TableChart';
import transformProps from '../src/transformProps';
import DateWithFormatter from '../src/utils/DateWithFormatter';
import testData from './testData';
import { mount } from './enzyme';

describe('plugin-chart-table', () => {
describe('transformProps', () => {
Expand Down
Loading