Skip to content

Commit

Permalink
Renames kbn-eslint-plugin-eslint to osd-eslint-plugin-eslint (#37) (#46)
Browse files Browse the repository at this point in the history
Signed-off-by: Bishoy Boktor <boktorbb@amazon.com>
  • Loading branch information
boktorbb authored and kavilla committed Mar 19, 2021
1 parent b2b2530 commit c485d7e
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 10 deletions.
3 changes: 0 additions & 3 deletions packages/kbn-eslint-plugin-eslint/README.md

This file was deleted.

3 changes: 3 additions & 0 deletions packages/osd-eslint-plugin-eslint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Custom ESLint rules for OpenSearch Dashboards

This package contains custom ESLint rules used for OpenSearch Dashboards development.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@kbn/eslint-plugin-eslint",
"name": "@osd/eslint-plugin-eslint",
"version": "1.0.0",
"private": true,
"license": "Apache-2.0",
"kibana": {
"opensearchDashboards": {
"devOnly": true
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ruleTester = new RuleTester({
},
});

ruleTester.run('@kbn/eslint/disallow-license-headers', rule, {
ruleTester.run('@osd/eslint/disallow-license-headers', rule, {
valid: [
{
code: dedent`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ruleTester = new RuleTester({
},
});

ruleTester.run('@kbn/eslint/no-restricted-paths', rule, {
ruleTester.run('@osd/eslint/no-restricted-paths', rule, {
valid: [
{
code: 'import a from "../client/a.js"',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ruleTester = new RuleTester({
},
});

ruleTester.run('@kbn/eslint/require-license-header', rule, {
ruleTester.run('@osd/eslint/require-license-header', rule, {
valid: [
{
code: dedent`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const path = require('path');
const KIBANA_ROOT = path.resolve(__dirname, '../../..');
const OPENSEARCH_DASHBOARDS_ROOT = path.resolve(__dirname, '../../..');

function checkModuleNameNode(context, mappings, node) {
const mapping = mappings.find(
Expand All @@ -44,7 +44,7 @@ function checkModuleNameNode(context, mappings, node) {
if (mapping.toRelative) {
const sourceDirectory = path.dirname(context.getFilename());
const localModulePath = node.value.replace(new RegExp(`^${mapping.from}\/`), '');
const modulePath = path.resolve(KIBANA_ROOT, mapping.toRelative, localModulePath);
const modulePath = path.resolve(OPENSEARCH_DASHBOARDS_ROOT, mapping.toRelative, localModulePath);
const relativePath = path.relative(sourceDirectory, modulePath);

newSource = relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
Expand Down
File renamed without changes.

0 comments on commit c485d7e

Please sign in to comment.