Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames kbn-eslint-plugin-eslint to osd-eslint-plugin-eslint (#37) #46

Merged
merged 1 commit into from Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
@@ -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