Skip to content

Commit

Permalink
Add eslint rule to forbid imports from path containing packages/ from…
Browse files Browse the repository at this point in the history
… root dir of OSD (opensearch-project#1500)

* Add lint rule to forbid imports from packages

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add eslint rule to forbid imports from path containing packages/ from root dir of OSD

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Co-authored-by: Stephen Crawford <65832608+scrawfor99@users.noreply.github.com>
Co-authored-by: Peter Nied <petern@amazon.com>
Signed-off-by: Sam <samuel.costa@eliatra.com>
  • Loading branch information
3 people authored and samuelcostae committed Aug 10, 2023
1 parent a40f8f0 commit 5034f93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ module.exports = {
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],
rules: {
// "@osd/eslint/require-license-header": "off"
'@osd/eslint/no-restricted-paths': [
'error',
{
basePath: __dirname,
zones: [
{
target: ['(public|server)/**/*'],
from: ['../../packages/**/*','packages/**/*']
},
]
}
]
},
overrides: [
{
Expand Down
1 change: 0 additions & 1 deletion server/saved_objects/saved_objects_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
SavedObjectsUpdateOptions,
SavedObjectsUpdateResponse,
} from 'opensearch-dashboards/server';
import { Config } from 'packages/osd-config/target';
import { SecurityPluginConfigType } from '..';
import { OpenSearchDashboardsAuthState } from '../auth/types/authentication_type';
import {
Expand Down

0 comments on commit 5034f93

Please sign in to comment.