'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';

const ruleName='must-avoid-non-null-assertions';const ruleContent='\x0a###\x20**Must**\x20avoid\x20using\x20wrong\x20non-null\x20assertions.\x0a\x0a####\x20Wrong\x0a\x0afunction\x20foo(bar?:\x20string)\x20{\x0a\x20\x20\x20\x20baz(bar!)\x0a}\x0a\x0afunction\x20baz(bar:\x20string)\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0a####\x20Correct\x0a\x0afunction\x20foo(bar?:\x20string)\x20{\x0a\x20\x20\x20\x20baz(bar)\x0a}\x0a\x0afunction\x20baz(bar?:\x20string)\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0aor\x0a\x0afunction\x20foo(bar?:\x20string)\x20{\x0a\x20\x20\x20\x20if\x20(bar)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20baz(bar)\x0a\x20\x20\x20\x20}\x0a}\x0a\x0afunction\x20baz(bar:\x20string)\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0a####\x20Why\x0a\x0aUsing\x20non-null\x20assertions\x20(!)\x20bypasses\x20TypeScript\x27s\x20type\x20checking\x20and\x20can\x20lead\x20to\x20runtime\x20errors\x20if\x20the\x20value\x20is\x20actually\x20null\x20or\x20undefined.\x20Instead\x20make\x20sure\x20if\x20the\x20value\x20is\x20actually\x20must\x20be\x20nullable\x20in\x20the\x20parent\x20component,\x20or\x20check\x20it\x20with\x20if\x20statement';var mustAvoidNonNullAssertions = createEslintRule(ruleName,ruleContent,_0xc59c48=>{return {'TSNonNullExpression'(_0x1f507e){_0xc59c48['report']({'node':_0x1f507e,'messageId':ruleName});}};});

export { mustAvoidNonNullAssertions as default, ruleName };
