frontend/eslint-plugin-streamlit-custom/README.md
A TypeScript-based ESLint plugin package for Streamlit-specific linting rules.
When making changes to this plugin during development:
Cmd+Shift+P / Ctrl+Shift+P) and run "ESLint: Restart ESLint Server"This is necessary because ESLint caches the plugin and won't automatically pick up changes until the server is restarted.
yarn test - Run the testsyarn testWatch - Run the tests and watch for changesyarn typecheck - Run the type checkerimport { createJiti } from "jiti"
// This is to support our custom rules, which are written in TypeScript,
// but need to be imported as JS to work in ESLint.
const jiti = createJiti(import.meta.url)
const __dirname = path.dirname(__filename)
const streamlitCustom = await jiti.import(
path.resolve(__dirname, "./eslint-plugin-streamlit-custom/src/index.ts"),
{ default: true }
)
export default [
{
plugins: {
"streamlit-custom": streamlitCustom,
},
rules: {
"streamlit-custom/use-strict-null-equality-checks": "error",
"streamlit-custom/no-hardcoded-theme-values": "error",
"streamlit-custom/enforce-memo": "error",
},
},
]