You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
965 B
32 lines
965 B
const eslint = require('@eslint/js')
|
|
const tseslint = require('typescript-eslint')
|
|
const figmaPlugin = require('@figma/eslint-plugin-figma-plugins')
|
|
|
|
module.exports = tseslint.config(
|
|
eslint.configs.recommended,
|
|
// @typescript-eslint/recommended-type-checked is too aggressive for
|
|
// widget code...it doesn't seem to like JSX element return values or
|
|
// unbundling the `widget` object for use* hooks. So we'll use
|
|
// tseslint.configs.recommended instead.
|
|
tseslint.configs.recommended,
|
|
{
|
|
plugins: {
|
|
'@figma/figma-plugins': figmaPlugin,
|
|
},
|
|
rules: {
|
|
...figmaPlugin.configs.recommended.rules,
|
|
// allow underscore-prefixing of unused variables
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
ignores: ['code.js', 'dist', 'eslint.config.js'],
|
|
},
|
|
)
|