npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jsegd-fluig-lint

v1.0.0

Published

Plugin de lint para projetos Fluig utilizando ESLint.

Readme

jsegd-fluig-lint

Plugin ESLint para validar código TypeScript compatível com Rhino (Java 11) executado na plataforma Fluig.

🎯 Objetivo

O Fluig utiliza o Rhino (engine JavaScript do Java) para executar código TypeScript transpilado. O Rhino possui limitações em relação ao JavaScript moderno (ES6+), e este plugin ajuda a identificar padrões incompatíveis durante o desenvolvimento, evitando erros em tempo de execução.

📦 Instalação

npm install jsegd-fluig-lint --save-dev

ou com yarn:

yarn add -D jsegd-fluig-lint

ou com pnpm:

pnpm add -D jsegd-fluig-lint

🚀 Uso com ESLint (ESM)

Configuração Recomendada (Mais Simples)

Crie ou edite o arquivo eslint.config.js (formato ESM):

import jsegdFluigLint from "jsegd-fluig-lint";

export default [
  {
    plugins: {
      "jsegd-fluig-lint": jsegdFluigLint,
    },
  },
  ...jsegdFluigLint.configs.recommended,
];

Esta configuração já inclui todas as regras necessárias, separadas por tipo de arquivo (.ts e .d.ts).

Configuração com TypeScript ESLint

Se você já usa typescript-eslint, pode combinar as configurações:

import globals from "globals";
import tseslint from "typescript-eslint";
import jsegdFluigLint from "jsegd-fluig-lint";

export default [
  { languageOptions: { globals: globals.browser } },
  ...tseslint.configs.recommended,
  // ✅ Plugin jsegd-fluig-lint aplicado apenas em pastas específicas
  {
    files: [
      "workflow/scripts/**/*.{js,mjs,cjs,ts}",
      "mechanisms/**/*.{js,mjs,cjs,ts}",
      "events/**/*.{js,mjs,ccs,ts}",
      "datasets/**/*.{js,mjs,cjs,ts}",
      "forms/*/events/**/*.{js,mjs,cjs,ts}",
    ],
    plugins: {
      "jsegd-fluig-lint": jsegdFluigLint,
    },
    ...jsegdFluigLint.configs.recommended[0],
  },
];

Configuração Manual Completa

Se preferir configurar manualmente todas as regras:

import jsegdFluigLint from "jsegd-fluig-lint";

export default [
  {
    plugins: {
      "jsegd-fluig-lint": jsegdFluigLint,
    },
  },
  {
    files: [
      "workflow/scripts/**/*.{js,mjs,cjs,ts}",
      "mechanisms/**/*.{js,mjs,cjs,ts}",
      "events/**/*.{js,mjs,ccs,ts}",
      "datasets/**/*.{js,mjs,cjs,ts}",
      "forms/*/events/**/*.{js,mjs,cjs,ts}",
    ],
    rules: {
      "jsegd-fluig-lint/no-strict-equality": "error",
      "jsegd-fluig-lint/no-arrow-functions": "error",
      "jsegd-fluig-lint/no-modern-es": "error",
      "jsegd-fluig-lint/no-optional-chaining": "error",
    },
  },
  {
    files: [
      "workflow/scripts/**/*.{js,mjs,cjs,ts}",
      "mechanisms/**/*.{js,mjs,cjs,ts}",
      "events/**/*.{js,mjs,ccs,ts}",
      "datasets/**/*.{js,mjs,cjs,ts}",
      "forms/*/events/**/*.{js,mjs,cjs,ts}",
    ],
    rules: {
      "jsegd-fluig-lint/only-declare-namespace": "error",
      "jsegd-fluig-lint/no-promises": "error",
      "jsegd-fluig-lint/no-generics": "error",
      "jsegd-fluig-lint/no-union-types": "error",
      "jsegd-fluig-lint/no-optional": "error",
    },
  },
];

📋 Regras Disponíveis

Para Runtime Rhino (arquivos .ts)

no-strict-equality

Proíbe o uso de === e !==, que não funcionam corretamente na interoperabilidade Java ↔ JavaScript no Rhino.

// ❌ Errado
if (value === null) {
}

// ✅ Correto
if (value == null) {
}

no-arrow-functions

Proíbe arrow functions, que não funcionam corretamente com interop Java no Rhino.

// ❌ Errado
const fn = () => console.log("test");

// ✅ Correto
function fn() {
  console.log("test");
}

no-modern-es

Proíbe o uso de tipos e estruturas modernas do JavaScript (ES6+) não suportadas pelo Rhino:

  • Map, Set, WeakMap, WeakSet
  • Symbol, BigInt
// ❌ Errado
const map = new Map();
const set = new Set();

// ✅ Correto - Use objetos simples
const map = {};
const set = [];

no-optional-chaining

Proíbe optional chaining (?.), não suportado pelo Rhino.

// ❌ Errado
const name = user?.profile?.name;
fn?.();

// ✅ Correto
const name = user && user.profile && user.profile.name;
if (fn) fn();

Para Contratos TypeScript (arquivos .d.ts)

only-declare-namespace

Exige que namespaces sejam declarados com declare.

// ❌ Errado
namespace MyNamespace {}

// ✅ Correto
declare namespace MyNamespace {}

no-promises

Proíbe o uso de Promise em contratos Rhino.

// ❌ Errado
function fetchData(): Promise<Data>;

// ✅ Correto
function fetchData(): Data;

no-generics

Proíbe o uso de generics em contratos Rhino.

// ❌ Errado
function process<T>(data: T): T;

// ✅ Correto
function process(data: any): any;

no-union-types

Proíbe union types em contratos Rhino.

// ❌ Errado
function getValue(): string | number;

// ✅ Correto
function getValue(): any;

no-optional

Proíbe campos e parâmetros opcionais (?) em contratos Rhino.

// ❌ Errado
interface User {
  name?: string;
}

// ✅ Correto
interface User {
  name: string;
}

🔧 Scripts package.json

Adicione scripts úteis ao seu package.json:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

📄 Licença

Consulte o arquivo LICENSE.md para mais detalhes.


Desenvolvido com ❤️ pela EGD Tecnologia