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 committed Mar 4, 2021
1 parent 2bb4a9d commit 673b55d
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
@@ -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.
@@ -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
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
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
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
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 673b55d

Please sign in to comment.